npm install jett-tools
const JETT = require('jett-tools')
// 调用dateFormat 对时间进行格式化
const gs = '-'
const dtStr = JETT.dateFormat(new Date(), gs)
console.log(dtStr)
// 调用 htmlEscape 对TML 中的特殊字符处理 调用 htmlUnEscape 对TML 中的特殊字符还原
// 待转换的HTML字符串
const htmlStr = '<h1 title="asb>这是h1标签<span>123 </span></h1>'
const ste= JETT.htmlEscape(htmlStr)
console.log(ste)// 转换的结果 <h1 title="asb>这是h1标签<span>123&nbsp;</span></h1>
const str2 = JETT.htmlUnEscape(ste)
console.log(str2) // 还原的结果 <h1 title="asb>这是h1标签<span>123 </span></h1>
ISC