Current collected state Current
Observed since 20 Oct, 19:29 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
提供了格式化时间、HTMLEscape相关的功能
npm install itheima-tools
const itheima = require('itheima-tools')
// 调用 dateFormat 对时间进行格式化
const dtStr = itheima.dateFormat(new Date())
// 结果 2020-04-03 17:20:58
console.log(dtStr)
// 带转换的 HTML 字符串
const htmlStr = '<h1 title="abc">这是h1标签<span>123 </span></h1>'
// 调用 htmlEscape 方法进行转换
const str = itheima.htmlEscape(htmlStr)
// 转换的结果 <h1 title="abc">这是h1标签<span>123&nbsp;</span></h1>
console.log(str)
// 待还原的 HTML 字符串
const str2 = itheima.htmlUnEscape(str)
// 输出的结果 <h1 title="abc">这是h1标签<span>123 </span></h1>
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 | 18 Jan 2023 | 0 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 19:29 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:27935c3ce0478efb7b193597991b6ac5004035d49844fb9ef3110a5c4f0b1ee3