1.0.0 • Published 2 years ago
itheima-tiem v1.0.0
安装
npm install itheima-time
导入
const itheima = require("itheima-time");
格式化时间
const dStr = itheima.dateFormat(new Date());
console.log(dStr); //结果2022-01-01 17:04:23
转移 html
//转换的字符串
const htmlstr = '<h1 title="abc">这是h1标签<span>123 </span></h1>';
const str = itheima.htmlEscpe(htmlstr);
console.log(str);
//结果<h1 title="abc">这是h1标签<span>123&nbsp;</span></h1>
开源协议
ISC
1.0.0
2 years ago