1.0.0 • Published 3 years ago
baobao-tools v1.0.0
##安装
npm install baobao-tools
##导入
const bao = require('baobao-tools')
##格式化时间
// 调用dataFormat对时间格式化
const dtStr = bao.dateFormat(new Date())
转义html字符
// 待转换的html字符串
const htmlStr ='<h1>这是h1标签</h1>'
// 进行转换
const hs = bao.htmlEscape(htmlStr)
console.log(hs);
还原html中的字符串
const htmlSStr = '<h1>这是h1标签</h1>'
const hss = bao.htmlUnEscape(htmlSStr)
console.log(hss);
##开源协议 ISC
1.0.0
3 years ago