poppy-tools
v1.0.0
Published
提供格式化时间,html转义功能
Downloads
1
Readme
安装
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