dsq_tool
1.0.1 • Public • Published
npm install dsq_tool
const dsq = require('dsq_tool')
// 调用dataFormat对时间进行格式化
const dtStr = dsq.dataFormat(new Date())
// 输出结果 2022-10-25 16:29:50
console.log(dtStr);
// 带转换的HTML字符串
const ht = '< h1 > "测试" & nbsp; < /h1>'
// 调用htmlEscape对字符串进行转义
const htStr = dsq.htmlEscape(ht)
// 输出结果< h1 > "测试" & nbsp; < /h1>
console.log(htStr);
// 还原的HTML字符串
const uht = '< h1 > "测试" & nbsp; < /h1>'
// 调用htmlUnEscape对字符串进行还原
const uhtStr = dsq.htmlUnEscape(uht)
// 输出结果< h1 > "测试" & nbsp; < /h1>
console.log(uhtStr);
ISC
Package Sidebar
Install
Weekly Downloads