1.0.1 • Published 2 years ago
le-utils v1.0.1
le-tools Doc
1.安装
npm install le-tools
2.导入
const le = require('le-tools');
3.格式化时间
//调用dateFormat对时间进行格式化
date.dateFormat(new Date());
//结果:2022-04-07 14:52:37
4.转义HTML中的特殊字符
console.log(date.HTMLEscape('<h1 id="h">h1标签<span style="color: red;">123 </span></h1>'));
// <h1 id="h">h1标签<span style="color: red;">123&nbsp;</span></h1>
5.还原HTML中的特殊字符
console.log(date.HTMLUnEscape('<h1 id="h">h1标签<span style="color: red;">123&nbsp;</span></h1>'));
// <h1 id="h">h1标签<span style="color: red;">123 </span></h1>
6.遵守的协议
ISC