1.0.0 • Published 2 years ago
poppy-tools v1.0.0
安装
npm install poppy-tools
导入
const poppy = require("poppy-tools")
格式化事件
const dtStr = poppy.dataFormat(new Date())
//结果 2022-10-31 08:00:00
console.log(dtStr)
转义HTML字符串
const htmlStr = '<h1>"&哈哈哈"</h1>'
const str = poppy.HTMLescape(htmlStr)
console.log(str)//<h1>"&哈哈哈"&lt;/h1>
还原HTML字符串
const str2 = poppy.HTMLUNescape(str)
console.log(str2)//<h1>"&哈哈哈"</h1>
开源协议
ISC
1.0.0
2 years ago