1.0.0 • Published 4 years ago
wjn-tool v1.0.0
安装
npm i wjn-tools导入
const wjn = require('wjn-tool')格式化时间
const timer = wjn.dateFormat(new Date())
console.log(timer);//结果2022-07-12 10:32:31转义 HTML 中的特殊字符
const htmlStr='<h1>这是一个h1标题</h1>'
const str=wjn.htmlExcape(htmlStr)
console.log(str);//<h1>这是一个h1标题</h1>还原 HTML 中的特殊字符
const str2=wjn.unhtmlExcape(str)
console.log(str2);//<h1>这是一个h1标题</h1>开源协议
ISC
1.0.0
4 years ago