1.0.0 • Published 2 years ago
zyjtools v1.0.0
安装
npm install zyjtools
导入
const gd = require('./zyjtools')
格式化时间
const date = new Date()
console.log(gd.dateFormat(date))
转义html
const htmlStr1 = '<h1 title="abc">这是一个h1<span>123 </span></h1>'
const str1 = gd.htmlEscape(htmlStr1)
console.log(str1)
转义字符串
const Str = '<h1 title="abc">这是一个h1<span>123&nbsp;</span></h1>'
const htmlstr = gd.htmlUnEscape(Str)
console.log(htmlstr)
开源协议
ISC
1.0.0
2 years ago