1.0.0 • Published 2 years ago
itheima-tools-huyuzhou v1.0.0
安装
npm install itheima-tools-hyz
导入
const itheima = require('./itheima-tools-hyz/index');
格式化时间
// 调用格式化时间函数
const dt = itheima.dateFormat(new Date());
console.log(dt);
转义html特殊字符
// 调用转义html特殊字符函数
const htmlStr = '<h1 style="background-color=pink">转义html的字符</h1>';
const str = itheima.htmlEscape(htmlStr);
console.log(str);
还原html特殊字符
// 调用还原html特殊字符函数
const htmlUnStr = '<h1 style="background-color=pink">转义html的字符</h1>';
const str2 = itheima.htmlUnEscape(htmlUnStr);
console.log(str2);
开源协议
ISC
1.0.0
2 years ago