itty-tools
v1.0.0
Published
提供了格式化时间, HTMLEscape 相关功能
Readme
安装
npm install itty-tools导入
const itty = require('itty-tools')格式化时间
itty.dateFormat(new Date('2020-1-1'))转移html中特殊字符
const htmlstr = '<h1 title="abc">这是H1标签<span>123 </span></h1 >'
const newStr = tool.htmlEscape(htmlstr);
// <h1 title="abc">这是H1标签<span>123&nbsp;</span></h1 >还原html中被转移的字符
const htmlstr = '<h1 title="abc">这是H1标签<span>123 </span></h1 >'
const newStr = tool.htmlEscape(htmlstr);
const oldStr = tool.htmlUnEscape(newStr);
// <h1 title="abc">这是H1标签<span>123 </span></h1 >开源协议
ISC
