1.0.0 • Published 2 years ago

burgess-tools v1.0.0

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

安装

npm install burgess-tools

导入

const burgess = require('burgess-tools')

格式化时间

//调用dateFormat对时间进行格式化;
const dt = burgess.dateFormat(new Date());

转义HTML中的特殊字符;

//待转换的HTML字符串;
const strHtml = '<h1>这是h1标题<span>123&nbsp;</span></h1>';
//调用htmlEscape进行转义;
const newStr = burgess.htmlEscape(strHtml);

开源协议

ISC