安装 npm install itheima-tools 导入 const itheima =require('itheima-tools') 格式化时间 // 调用dateFormat 对时间进行格式化 const data= itheima.dateFormat(new Date()) console.log(data) 转义HTML中的特殊字符 var html1='<h1 title="abc">这是H1标签<span>123 </span></h1>' const h1= itheima.htmlEscape(html1) console.log(h1) 开源协议 ISC