1.0.0 • Published 2 years ago
lwl-tools v1.0.0
安装方式
npm install lwl-tools
导入
var lwl = require('lwl-tools')
格式化时间
console.log(lwl.dateFormat(new Date()));
转义 HTML 中的特殊字符
var htmlStr = '<h1 title="abc">你好呀 </h1>';
console.log(lwl.htmlEscape(htmlStr));
还原 HTML 中的特殊字符
var htmlStr = '<h1 title="abc">你好呀&nbsp;</h1>'
console.log(lwl.htmlUnEscape(htmlStr));
开源协议
ISC
1.0.0
2 years ago