安装
npm install wu-npm-a
导入
const wuNpmA = require('wu-npm-a')
格式化时间
// 调用dateFormat对时间进行格式化
const dtStr = wuNpmA.dateFormat(new Date())
console.log(dtStr)
转义 HTML 中的特殊字符
// 调用htmlEscape转义HTML字符
const htmlStr = wuNpmA.htmlEscape('<h1>哈哈哈</h1>')
console.log(htmlStr)
还原 HTML 中的特殊字符
// 调用htmlUnEscape还原HTML字符
const str = wuNpmA.htmlUnEscape('<hhh>')
console.log(str)
开源协议
ISC