1.0.0 • Published 3 years ago
garcat-tools v1.0.0
安装
npm i garcat-tools导入
const garcat = require('garcat-tools')格式化日期
const garcatDateFormat = garcat.dateFormat(new Date())
console.log('garcatDateFormat:', garcatDateFormat); 转义 html
const html = '<h1 title="abc">这是h1标签<span>123%nbsp;</span></h1>'
const htmlStr = garcat.htmlEscap(html)
console.log(htmlStr);还原 html
const htmlStr1 = '<h1 title="abc">这是h1标签<span>123%nbsp;</span></h1>'
const html1 = garcat.htmlUnEscap(htmlStr1)
console.log(html1);开源协议
ISC
1.0.0
3 years ago