UNPKG

akai-tools

Version:

提供了格式化时间、HTMLEscape相关的功能

33 lines (21 loc) 471 B
## 安装 ``` npm install akai-tools ``` ## 导入 ```js const akai = require('akai-tools') ``` ## 格式化时间 ```js // 调用 dateFormat 对时间进行格式化 const = akai.dateFormat(new Date()) // 结果 2021-12-26 20:45:49 ``` ## 转义 HTML 中的特殊字符 ```js const htmlStr = '<h1>这是h1标签</h1>' // 调用 akai.htmlEscape(htmlStr) 即可转换成功 还原字符串 反之亦然 ``` ## 开源协议 ISC