这是一个工具包,可以格式化时间,可以转换网页字符串,也可以解析网页字符串
npm i myguigu-util-tools
const utils = require('./index')
const now = new Date()
const str = utils.dateFormat(now)
console.log(str);
const html = '<h1 title="标题">这是h1标题 </h1>'
const str1 = utils.htmlEscape(html)
console.log(str1);
// <h1 title="标题">这是h1标题 &nbsp;</h1>
const str2 = '<h1 title="标题">这是h1标题 &nbsp;</h1>'
const html2 =utils.htmlUnEscape(str2)
console.log(html2);
ISC