1.0.1 • Published 2 years ago
zzs-tools v1.0.1
安装
npm install zzs-tools
导入
const zzs = require('zzs-tools')
格式化时间
const dtStr = zzs.dateFormat(new Date())
console.log(dtStr);
转义 HTML 中的特殊字符
const htmlStr = '<h1 title="abc">这是哈的</h1>'
const str = zzs.htmlEscape(htmlStr)
console.log(str);
还原 HTML 中的特殊字符
const str2 = zzs.htmlUnEscape(str)
console.log(str2);
发布
npm publish