damian_tools
Version:
提供了格式化时间,HTMLEscape的功能
32 lines (27 loc) • 598 B
Markdown
## 安装
```
npm install damian_tools
```
## 导入
```js
const damian_tools = require("damian-tools")
```
## 时间格式化
```
const newDT = damian_tools.dateFormat()
console.log(newDT)
```
## 转义HTML中的特殊字符
```
const htmlStr = '<h1 title = "abc">这是h1标签<span>123 </span></h1>'
const str = damian_tools.htmlEscape(htmlStr)
console.log(str)
```
## 还原HTML中的特殊字符
```
// 输出的结果是 <h1 title = "abc">这是h1标签<span>123&nbsp;</span></h1>
const str2 = damian_tools.htmlUnEscape(str)
console.log(str2)
```
## 开源协议
ISC