1.1.1 • Published 12 months ago

hua-tools v1.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months ago

安装

npm install hua-tools

导入

const hua = require('hua-tools')

时间格式化

//引用时间格式化函数
const newDt = hua.dataFormat(new Date())
console.log(newDt);
// 结果为 2023-05-26 11:10:26

转义HEML特殊字符

const str = '<h1>我是一个天才啊</h1>'
const escapeStr = hua.htmlEscape(str)
console.log(escapeStr);
// 结果为&lt;h1&gt;我是一个天才啊&lt;/h1&gt;

还原HTML特殊字符

const str2 = hua.htmlUnEscape(escapeStr)
console.log(str2);
// 结果为<h1>我是一个天才啊</h1>

开源协议

ISC

1.1.1

12 months ago

1.0.0

2 years ago