1.0.0 • Published 1 year ago

piu-tools v1.0.0

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

安装

npm install biu-tools

导入

const index = require("biu-tools");

格式化时间

//调用dateFormat对时间格式化
const dtStr = index.dateFormat(new Date());
//打印格式化的时间
console.log(dtstr);

转义和还原 HTML 中的特殊字符

//带转换的HTML字符串
const htmlStr = index.htmlEscape("<>|&123");
//转换的结果是 &lt;&gt;|&amp;123
console.log(htmlStr);
//还原带转换的HTML字符串
const BackHtmlStr = index.htmlEsback(htmlStr);
//转换的结果是 <>|&123
console.log(BackHtmlStr);

开源协议

ISC