npm install itheima-chen-bzhan
const itheima = require('itheima-chen-bzhan')
// 调用 dateFormat 对时间进行格式化
const dtStr = itheima.dateFormat(new Date())
// 结果 2023-04-03 17:20:58
console.log(dtStr)
// 带转换的 HTML 字符串
const htmlStr = '<h1 style="color:red">这是红色的h1<span>span</span></h1>'
// 调用 htmlEscape 方法进行转换
const str = itheima.htmlEscape(htmlStr)
// 转换的结果 <h1 style="color:red">这是红色的h1<span>span</span></h1>
console.log(str)
// 待还原的 HTML 字符串
const str2 = itheima.htmlUnEscape(str)
// 输出的结果 <h1 style="color:red">这是红色的h1<span>span</span></h1>
console.log(str2)
ISC