1.0.0 • Published 5 years ago

tang_toolss v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

##安装方式

npm install tang_toolss

##导入方式

const m = require('toolss')

##格式化时间

// 调用dateFormat对时间进行格式化
const dtStr = m.dataFormat(new Date());
// 输出结果
console.log(dtStr);

##转义HTML中的特殊字符

// 待转换的HTML字符串
const htmlStr = '<h1 title="abc">这是h2标签<span>123&nbsp;</span></h1>'
// 调用htmlEscape方法进行转换
const str = m.htmlEscape(htmlStr);
// 输出结果
console.log(str);

##还原HTML中的特殊字符

// 待还原的HTML字符串
const str2 = m.htmlUnEscape(str);
// 输出结果
console.log(str2);

##开源协议 ISC

1.0.0

5 years ago