##安装
npm install itheima-yzh-tools
##导入
const itheima=require('./itheima-yzh-tools/index')
##格式化时间函数
const dt=new Date()
//用dateFormat方法对时间进行初始化
const newDT=itheima.dateFormat(dt)
//输出结果:2022-11-15 11:42:37
console.log(newDT)
##转义HTML中的特殊字符
const htmlStr="<h1>这是一个h1标签<span>span标签 </span></h1>"
//用htmlEscape方法转义HTML中的特殊字符
const escape=itheima.htmlEscape(htmlStr)
//输出结果:<h1>这是一个h1标签<span>span标签&nbsp;</span></h1>
console.log(escape)
##还原HTML中的特殊字符
//用htmlUnEscape方法还原HTML中的特殊字符
const unEscape=itheima.htmlUnEscape(escape)
//输出结果:<h1>这是一个h1标签<span>span标签 </span></h1>
console.log(unEscape)
##开源格式 ISC