1.0.0 • Published 1 year ago

tool-slc29 v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

##安装

npm install tool-lc

##导入

const tool = require("tool-lc");

##格式化时间

// 调用dateFormat对时间进行格式化
const dt = new Date();
console.log(tool.dateFormat(dt));

##转义 HTML 字符

//待处理的HTML字符串
const htmlStr = '<h1 title="abc">这是h1标签<span>123&nbsp;</span></h1>';
// 调用htmlEscape方法转换
const str = tool.htmlEscape(htmlStr);
console.log(str);

##还原 HTML 字符串

//待还原HTML字符串
const initHTML = tool.htmlUnEscape(str);
console.log(initHTML);

##开源协议

ISC
1.0.0

1 year ago