1.0.0 • Published 12 months ago
liuqi-tools v1.0.0
安装
npm install liuqi-tools
导入
const LiuQi = require('liuqi-tools')
格式化时间
// 调用 dateFormat 对时间进行格式化
const dtStr = Lq.dataFormat(new Date())
console.log(dtStr);
转义Html中的特殊字符
//代转换的HTML字符串
const Str = "<h1 style='like'>代码 <span>123</span></h1>"
// 调用方法进行转换
const htmlEscape = Lq.htmlEscape(Str)
console.log(htmlEscape);
还原Html中的特殊字符
// 带转换的Html字符串
const Str2= Lq.htmlUnEscape(htmlEscape)
console.log(Str2);
开源协议
ISC
1.0.0
12 months ago