1.0.0 • Published 2 years ago
jetwang-tools v1.0.0
jetwang-tools 使用说明文档
安装
npm install jetwang-tools
导入
const jetwang = require('jetwang-tools')
时间格式化
const dtStr = jetwang.dateFormat(new Date())
console.log(dtStr)
转义html中特殊字符
// 待转义的字符
let str = '<p style="color: red">jetwang</p>'
// 转换后结果 <p style="color: red">jetwang</p>
str = jetwang.htmlEscape(str)
console.log(str)
还原html中特殊字符
// 待还原的字符
let str = '<p style="color: red">jetwang</p>'
;
// 还原后字符 <p style="color: red">jetwang</p>
str = jetwang.htmlUnEscape(str)
console.log(str)
开源协议
ISC
1.0.0
2 years ago