1.0.0 • Published 3 years ago
sunayu-tools v1.0.0
安装
、、、 npm install sunayu-tools 、、、
导入
、、、js const sunayu=require('sunayu-tools') 、、、
格式化时间
、、、js
const dtStr = index.dateFormat(new Date());
console.log(dtStr) 、、、
转译HTML中的特殊字符
、、、js
const htmlStr = <h1 title="abc">你是神魔恋<span>123 </span></h1>
const htmlstr = index.htmlEscape(htmlStr);
console.log(htmlstr) 、、、
还原HTML的特殊字符
、、、js
const str = index.htmlUnEscape(htmlstr)
console.log(str); 、、、
开源协议
ISC
1.0.0
3 years ago