1.0.1 • Published 2 years ago
scarlett-tool v1.0.1
安装
npm install mytools
导入
const test = require('./mytools');
格式化时间
//调用dateFormat
const dt = test.dateFormat(new Date());
console.log(dt);
转义
const html = '<h1 title="a">这是标签</h1>';
const str = test.htmlEscape(html)
console.log(str); //<h1 title="a">这是标签</h1>
console.log(test.htmlUnEscape(str));//<h1 title="a">这是标签</h1>
开源协议
ISC
1.0.1
2 years ago