Current collected state Current
Observed since 20 Oct, 20:43 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 | 12 Nov 2022 | 0 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 20:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:7136034e8dfa6b1d6c11278505a85ddf93798620f7c97dd83a15df8bb7283804