Current collected state Current
Observed since 20 Oct, 20:36 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
格式化时间,html和escape
npm install 5itheima-tools
const itheima = require("5itheima-tools");
//调用dateFormat对时间进行格式化
const dateStr = itheima.dateFormat(new Date());
// 结果 2022-10-04 22:40:30
console.log(dateStr);
// 带转换的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);
// 待还原的字符串
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 | 4 Oct 2022 | 0 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 20:36 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:282eca344437e662ce0ece9e2b63a33c5143afebf089d60a1917047d301d5217