zpc-tools
v1.0.0
Published
提供了格式化时间,HTMLEscape的功能
Downloads
8
Readme
安装
npm install zpc-tools;
导入
const zpc = require('zpc-tools');
格式化时间
// 对事件进行格式化
const dtStr = zpc.dataFormat(new Date());
console.log(dtStr);
转移html字符
// 待转化的html字符
const htmlStr = '<h1 class="box"> 喀喀喀</h1>';
// 调用htmlStr进行转化
const str = zpc.htmlEscape(htmlStr);
console.log(str);
还原html字符
// str:待还原的字符 调用htmlShow方法
const str1 = zpc.htmlShow(str);
console.log(str1);
##开源协议 ISC