1.0.0 • Published 3 years ago
myheima-tools123 v1.0.0
##安装方式
npm i itheimamytools
##导入方式
const itheimamytools=require('itheimamytools')
##格式化时间
//调用dateFormat对时间进行格式化
const date = itheimamytools.dateFormat(new Date())
//输出2021-10-26 18:23:11
console.log(date);
##转义 HTML 中的特殊字符
//调用htmlEscape转义html字符串
const htmlStr = itheimamytools.htmlEscape("<h1>Hello world</h1>");
//输出<h1>Hello world</h1>
console.log(htmlStr);
##还原 HTML 中的特殊字符
//调用htmlUnEscape还原html字符串
const html = itheimamytools.htmlUnEscape("<h1>Hello world</h1>")
//输出<h1>Hello world</h1>
console.log(html);
##开源协议
ISC
1.0.0
3 years ago