1.0.0 • Published 2 years ago
itleizi-tools v1.0.0
安装
npm install itleizi-tools
引用
const itcolin = require('itleizi-tools')
使用1:时间格式化
const tmie = itcolin.getDtime(new Date())
console.log('tmie:', tmie)
// 2023-02-28 15:15:15
使用2:转义html
const str = '<h1 style="height: 20px;">66666</h1>'
const htmlStr = itcolin.htmlEscape(str)
console.log('htmlStr:', htmlStr)
// 打印结果:<h1 style="height: 20px;">66666</h1>
使用3:反义html
const htmlStr = '<h1 style="height: 20px;">66666</h1>'
const html = itcolin.unHtmlEscape(htmlStr)
console.log('html:', html)
// 打印结果: <h1 style="height: 20px;">66666</h1>
1.0.0
2 years ago