tweetball-lmytools
v1.0.0
Published
提供了格式化时间,HTMLEscape相关的功能
Downloads
3
Readme
安装
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
