1.0.0 • Published 2 years ago
gaishiyingxiong_utils v1.0.0
安装
npm install gaishiyingxiong_utils
导入
const utils = require('gaishiyingxiong_utils')
常用时间格式处理
const date = new Date()
// 结果 2022-09-11 12:26:28
console.log(utils.dateformat(date);
常用html字符转义处理
const str = '<h1>我是h1标签<span> a&b </span></h1>'
// 结果 <h1>我是h1标签<span> a&b </span></h1>
console.log(utils.htmlEscape(str));
常用html字符返还转义处理
const str = '<h1>我是h1标签<span> a&b </span></h1>'
// 结果 <h1>我是h1标签<span> a&b </span></h1>
console.log(utils.htmlUnEscape(str));
开源协议
ISC
1.0.0
2 years ago