dch-utils01
v1.0.0
Published
这是一个格式化时间和转义html标签的包
Downloads
3
Readme
1.安装
npm i dch-utils
2.引入
const utils = require('dch-utils');
3. 使用
- 3.1 调用格式化时间的函数
const dt = utils.dateFormat(new Date);
//2021-2-21 15:52:26
console.log(dt);
- 3.2 调用转义html标签的方法
const res = utils.escapeHTML('<span style="color:red">hello </span>');
//<span style="color:red">hello&nbsp</span>
console.log(res);
- 3.3 调用还原html标签的方法
const res2 = utils.unEscapeHTML('<span style="color:red">hello&nbsp</span>');
//<span style="color:red">hello </span>
console.log(res2);
4.协议
MIT