npm install cjj-tools
const cjj_tools = require('cjj-tools')
const date = cjj_tools.formatDate(new Date)
// 转换后的结果: 2022-12-28 23:18:51
// 转换前的HTML字符串
const htmlStr = '<h1 style="">asdfasd </h1>'
// 转换后的结果: <h1 style="">asdfasd&nbsp;</h1>
console.log(cjj_tools.htmlEscape(htmlStr));
// 转换前的字符串
const htmlUnStr = '<h1 style="">asdfasd&nbsp;</h1>'
// 转换后的结果: <h1 style="">asdfasd </h1>
console.log(cjj_tools.htmlUnEscape(htmlUnStr));
ISC