Current collected state Current
Observed since 20 Oct, 17:27 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
提供了格式化时间、HTMLEsacape相关的功能
npm install 07-tools
##导入
const tools = require('/07-tools')
##格式化时间
//调用dateFormat对时间进行格式化
const dtStr = tools.dateFormat(new Date())
//结果 2022-03-32 11:39:03
console.log(dtStr)
##转义html中的特殊字符
//带转换的html字符串
const htmlStr = '<h1 title="hzp">这是h1标签<span>123 </span></h1>'
//调用htmlEscape方法进行转换
const str = tools.htmlEscape(htmlStr)
//转换的结果
console.log(str)
##还原html中的特殊字符
//代还原的html字符串
const str2 = tools.htmlUnEscape(str)
//输出的结果
console.log(str2)
ISC
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.0Registry latest | 31 Mar 2022 | 0 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 17:27 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:720e6ec28c3d6880940684a9365b431567d3391621d79e4d315413c0e99f8aa9