lysun
v1.0.0
Published
提供了格式化时间,HTMLEscape相关的功能
Downloads
1
Readme
安装
npm install lysun
导入
const lysun = require('lysun');
格式化时间
const date = new Date();
//输出 2024-2-19 17:31:13
console.log(lysun.formatDateTime(date));
html 字符串转义
const htmlStr = '<h1>你好啊&</h1>';
const str = lysun.escapeHtml(htmlStr);
// 输出 <h1>你好啊&</h1> str
console.log(str, 'str');
html 字符串还原
const str2 = lysun.unescapeHtml(str);
// 输出 <h1>你好啊&</h1> str2
console.log(str2, 'str2');
开源协议
ISC