1.0.0 • Published 1 year ago
syz-time-format v1.0.0
安装
npm install syz-time-format
导入方式
const syz = require('syz-time-format')
本包一共三个方法
- 格式化时间方法
const syz = require('syz-time-format')
// 调用包上的format方法即可转换时间戳
syz.format(new Date())
// 当前时间为2023-01-18 11:19:29
- 转义和还原html字符串
const syz = require('syz-time-format')
const htmlStr = '<h1 class="abc">你好啊 node.js</h1>'
// 转义html的方法
syz.htmlEscape(htmlStr));
// <h1 class="abc">你好啊&nbsp;node.js</h1>
// 还原html的方法
syz.htmlUnEscape(htmlStr);
// <h1 class="abc">你好啊 node.js</h1>
开源协议
ISC
1.0.0
1 year ago