1.0.0 • Published 5 years ago

lgq-tools v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

安装

npm install lgq-tools

导入

const lgq-tools=require('lgq-tools')

格式化时间

// 格式化时间的功能
const dtStr = lgq.dataFormat(new Date())
console.log(dtStr);

转义html中的特殊字符

// 转义html字符串
const htmlStr = '<h1 title="abc">这是一个H1标签<span>123&nbsp</span></h1>'
const str = lgq.htmlEscape(htmlStr)
console.log(str);

还原html中的特殊字符

//还原html字符串
const newStr = lgq.htmlUhEscape(str);
console.log(newStr);

开源协议

ISC
1.0.0

5 years ago