1.0.0 • Published 2 years ago
tweetball-lmytools v1.0.0
安装
npm install lmy-tools
导入
const lmy=require('lmy-tools');
格式化时间
//调用时间格式化函数对时间进行格式化
const dtStr=lmy.dateformat(new Date());
//输出现在时间的格式化形式
console.log(dtStr);
转义HTML中的特殊字符
const htmlStr='<h1 title="abc">这是h1标签<span> </span></h1>';
const str=lmy.htmlEscape(htmlStr);
console.log(str);
还原HTML中的特殊字符
const str2=lmy.htmlUnescape(str);
console.log(str2);
开源协议
ISC
1.0.0
2 years ago