1.0.1 • Published 2 years ago
afrck-date-fromat v1.0.1
安装
npm install afrck-dateFormat
使用
1.导入
const afrck_StrFormat = require('./afrck-dateFormat');
时间格式化
const dt = new Date().afrck_StrFormat.dateFormat(dt)
Run 2022-05-22 21:30:31
转义html片段特殊字符
const htmlStr = '<h1 style="color:red;">Hello© World><span>张三</span></h1>';
const str = afrck_StrFormat.htmlEscape(htmlStr);
Run <h1 style="color:red;">Hello&copy; World><span>张三</span></h1>
还原转义的字符
const str = '<h1 style="color:red;">Hello&copy; World><span>张三</span></h1>'
const rewHtml = afrck_StrFormat.htmlUnescape(str);
Run <h1 style="color:red;">Hello© World><span>张三</span></h1>
开源协议
ISC
1.0.1
2 years ago