1.0.0 • Published 4 years ago
bundle-tools-forthisright v1.0.0
安装
npm install Bundle-tools导入
const Bundle-tools = require('Bundle-tools')格式化时间
//调用dateFormat对时间进行格式化
const dtStr = Bundle.dateFormat(new Date())
console.log(dtStr)转义HTML中的特殊字符
//定义了待转换的HTML字符串
const htmlStr = '<h1 title="abc">这是h1标签<span>123 </span></h1>'
//调用方法进行转换
const str = Bundle.htmlEscape(htmlStr)
console.log(Str) 还原HTML中的特殊字符
//定义了待还原的HTML字符串
const str2 = Bundle.htmlUnEscape(str)
//调用方法进行转换
console.log(str2) 开源协议
MIT
1.0.0
4 years ago