zk309
v1.0.1
Published
提供了格式化时间, HTMLEscape的功能.
Downloads
6
Maintainers
Readme
安装方式
npm install zk309
导入方式
const zk309 = require('zk309');
格式化时间
const dt = zk309.dateFormat(new Date());
console.log(dt);
// 输出 2022-04-19 11:33:40
转义 HTML 中的特殊字符
const htmlStr = '<h1 style="red">你好!&</h1>';
const str = zk309.htmlEscape(htmlStr);
console.log(str);
// <h1 style="red">你好!&</h1>
还原 HTML 中的特殊字符
const rawStr = zk309.htmlUnEscape(str);
console.log(rawStr);
// <h1 style="red">你好!&</h1>
开源协议
ISC