xzit

1.0.0 • Public • Published

安装

npm install xzit

导入

const xzit = require('xzit')

格式化时间

// 调用dateFormat 对时间进行初始化
const time = new Date
const ti = xzit.timeFormat(time)

转义HTML字符串

// 待转换的HTML字符串
const tstr = '<h2 title = "abd">标题<span>a&b</span></h2>'
// 输出结果: &lt;h2 title = &quot;abd&quot;&gt;标题&lt;span&gt;aundefinedb&lt;/span&gt;&lt;/h2&gt;
const nStr = xzit.ctnj(tstr)

还原HTML中特殊字符串

// 待还原的HTML字符串
const str = '&lt;h2 title = &quot;abd&quot;&gt;标题&lt;span&gt;aundefinedb&lt;/span&gt;&lt;/h2&gt;'
// 还原结果:<h2 title = "abd">标题<span>a&b</span></h2>
const newStr = xzit.ctn(str)

开源协议

ISC

Readme

Keywords

Package Sidebar

Install

npm i xzit

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

2.53 kB

Total Files

5

Last publish

Collaborators

  • iszhangzq