npm install itheima-tools-zzw
const itheima = require("itheima-tools-zzw");
// 调用dataFormat()方法
const dtStr = m1.dateFormat(new Date());
// 格式化时间的功能
console.log(dtStr); // 2022-09-27 17:13:30
// 待转换的 html 字符
const htmlStr = `<h1 title="擦"><p>怕</p><span>帝</span><strong>"秋夜长&&"</strong></h1>`;
// 调用 htmlEscape 方法进行转换
const htStr = m1.htmlEscape(htmlStr);
console.log(htStr);
// 结果 : <h1 title="擦"><p>怕</p><span>帝</span><strong>"秋夜长&&"</strong></h1>
const Uhtml = m1.htmlUnEscape(htStr);
console.log(Uhtml);
// 输出 : <h1 title="擦"><p>怕</p><span>帝</span><strong>"秋夜长&&"</strong></h1>
ISC