1.0.0 • Published 5 years ago
yj-tools v1.0.0
1.安装
npm i yj-tools
2.导入
const yj = require('yj-tools')
3.格式化时间
// 格式化时间的功能
const dtStr = yj.dateFormat(new Date())
console.log(dtStr)
4.转译
const htmlStr = '<h1 title="abc">这是h1标签<span>123 </span></h1>'
const str = yj.htmlEscape(htmlStr)
console.log(str)
5.还原
const htmlStr = '<h1 title="abc">这是h1标签<span>123 </span></h1>'
const str2 = yj.htmlUnEscape(htmlStr)
console.log(str2)
6.开源协议
ISC
1.0.0
5 years ago