1.0.0 • Published 1 year ago

mypackage-six v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

安装

npm install mypackage-six

导入

const mypackage-six = ('mypackage-six')

格式化时间

const datestr = mypackage-six.dateFormat(new Date())
console.log(datestr);

转义/还原html中的特殊字符

//转义
const htmlstr = '<h1 title="abc">这是h1标签<span>13&nbsp;</span></h1>'
const newstr = mypackage-six.htmlEscape(htmlstr)
console.log(newstr);

//还原
const newhtmlstr = mypackage-six.htmlUnEscape(newstr)
console.log(newhtmlstr);

开源协议

ISC