1.0.0 • Published 2 years ago
lishuaidashabi v1.0.0
安装
npm i lishuaidashabi
导入
js
const index = require('./lishuaidashabi')
格式化时间
js
// 调用 time 对时间进行格式化
const time1 = new Date();
const time2 = index.time(time1)
console.log(time2);
转义 HTML 中的特殊字符
js
// 带转换的 HTML 字符串
const htmlStr = '<div style="height:500px; width:500" background:red;">这是div标签<span>12 3</span></div>'
// 调用 htmlzyzf 方法进行转换
const html = index.htmlzyzf(htmlStr)
console.log(html);
还原 HTML 中的特殊字符
js
// 待还原的 HTML 字符串
const str = index.htmlUnEscape(html)
console.log(str);
开源协议
ISC
1.0.0
2 years ago