这是一个工具包,可以格式化时间,转义HTML中的特殊字符,还原HTML中的特殊字符
nmp i mypackege-utils-sjx
let test = require("./index")
let now = new Date()
let time = test.dateFormat(now)
console.log(time)
let html = '<h3 class="color">标题 </h3>'
let title1 = test.htmlReplace(html)
console.log(title1)
let str = '<h3 class="color">标题 </h3>'
let title2 = test.strReplace(str)
console.log(title2)
ISC