npm install itzyj-tools
const itzyj = require('itzyj-utils')
// 调用 dateFormat 对时间进行格式化
const dtStr = itzyj.dateFormat(new Data())
console.log(dtStr)
// 结果 2022-7-30 17:37:58
// 待转换的 HTML 字符串
const htmlStr = '<h1 title="标题">首页<span>123&npsp;</span></h1>'
// 调用 htmlEscape 方法进行转换
const str = itzyj.htmlEscape(htmlStr)
// 转换的结果 <h1 title="标题">首页<span>123&npsp;</span></h1>
// 待还原的HTML 字符串
const str2 = itzyj.htmlUnEscape(str)
console.log(str2)
// 输出的结果 <h1 title="标题">首页<span>123&npsp;</span></h1>
ISC