1.1.0 • Published 2 years ago

hbmu-tools v1.1.0

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

##安装

npm install 

##导入

const hbmu=require('hbmu-tools')

##格式化时间

//调用dateFormate 对时间进行格式化
let dtStr = hbmu.dateFormat(new Date())
//结果  2022-0721 21:14:26
console.log(dtStr);

##转译HTML中的特殊字符

//待转换的HTML字符串
let htmlStr = '<h1>hello<h1>'
//调用htmlEscape 方法进行转换
let newStr = hbmu.htmlEscape(htmlStr)
//转换的结果  &lt;h1&gt;hello&lt;h1&gt;
console.log(newStr);

##还原HTML中的特殊字符

##开源协议 ISC