1.0.0 • Published 2 years ago
node1-tools v1.0.0
安装
npm install node1-tools
导入
const node1-tools = require('node1-tools')
格式化时间
const dtStr = index.dateFormat(new Date())
console.log(dtStr);
转义html
const html = '<h1>这是h1标签 </h1>'
// 转义HTML
const str = index.htmlEscape(html)
console.log(str);
// 还原HTML
const newStr = index.htmlUnEscape(str)
console.log(newStr);
开源协议
ISC
1.0.0
2 years ago