hg-tools
v1.0.0
Published
提供了格式化时间、htmlEscape相关的功能
Downloads
5
Readme
安装
npm install hg-tools
导入
const hg = require('hg-tools')
格式化时间
//调用dateformat对时间进行格式化
const dt= it.dateformat(new Date())
console.log(dt);
转义tml中的特殊字符
const htmlstr = '<h1>一级标题</h1>'
const str= it.htmlEscape(htmlstr)
console.log(str);
还原html中的特殊字符
const s = '<h1>一级标题</h1>'
const a = it.htmlUnEscape(s)
console.log(a);
开源协议
ISC