tool-evans
Version:
这是一款卢本伟用了都说好的格式化时间和转义HTML插件
40 lines (29 loc) • 569 B
Markdown
## 包的使用说明文档
## 安装
```shell
npm i tool-lubenwei
```
## 引入
```js
const tool = require('tool-lubenwei')
```
## 使用
```js
// 调用格式化日期函数
const res1 = tool.formatTime(new Date())
console.log(res1)
```
```js
// 调用转义 html 标签的方法
const res2 = tool.escapeHTML('<span style="color: red">hello</span>')
console.log(res2)
```
```js
// 调用还原 html 标签的方法
const res3 = tool.unescapeHTML(
'<span style="color: red">hello</span>'
)
console.log(res3)
```
## 许可协议
MIT