1.0.0 • Published 4 years ago
wxh_tools-cd v1.0.0
安装
npm install wxh_tools-cd
导入
const wxh = require('./wxh_tools-cd')
日期格式化
// 测试格式化日期
const str1 = wxh.dataFormat(new Date());
console.log(str1);
测试 转译
// 测试 转译
const htmlStr = '<h1>我是h1标签<span>123 </span></h1>'
const str2 = wxh.htmlEscape(htmlStr)
console.log(str2);
// '<h1>我是h1标签<span>123 &nbsp;</span></h1>'
测试 还原
//测试 还原
const str3 = wxh.htmlUnEscape(str2);
console.log(str3);
// <h1>我是h1标签<span>123 </span></h1>
开源协议
ISC
1.0.0
4 years ago