hms-tools

1.0.0 • Public • Published

安装

npm install diy

导入

const diy = require('diy')

格式化时间

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

转义 HTML 中的特殊字符

const str = hms.htmlEscape(htmlStr)
console.log(str);
// 转换结果:<h1>"&123 </h1>

还原 HTML 中的字符串

const str2 = hms.htmlUnEscape(str)
console.log(str2);
// 还原结果:<h1>"&123&nbsp;</h1>

开源协议

ISC

Readme

Keywords

Package Sidebar

Install

npm i hms-tools

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

731 kB

Total Files

34

Last publish

Collaborators

  • songhu723