0.0.1 • Published 3 years ago
lijun199728 v0.0.1
安装包
npm i my-package
导入包
const format = require('./my-package')
时间格式化方法
const d = format.formatDate('2021/4/11')
console.log(d); //2021-04-11 00:00:00
html转义
const str = "<span> hello &nbmp; </span>"
console.log(format.htmlEscape(str)); //≶span> hello &nbmp; ≶/span>
html文本反转
const str2 = format.unHtmlEscape('≶span> hello &nbmp; ≶/span>');
console.log(str2); /<span> hello &nbmp; </span>
协议
MIT
0.0.1
3 years ago