zyjtools

1.0.0 • Public • Published

安装

npm install zyjtools

导入

const gd = require('./zyjtools')

格式化时间

const date = new Date()

console.log(gd.dateFormat(date))

转义html

const htmlStr1 = '<h1 title="abc">这是一个h1<span>123&nbsp;</span></h1>'

const str1 = gd.htmlEscape(htmlStr1)

console.log(str1)

转义字符串

const Str = '&lt;h1 title=&quot;abc&quot;&gt;这是一个h1&lt;span&gt;123&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;'

const htmlstr = gd.htmlUnEscape(Str)

console.log(htmlstr)

开源协议

ISC

/zyjtools/

    Package Sidebar

    Install

    npm i zyjtools

    Weekly Downloads

    1

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    2.54 kB

    Total Files

    5

    Last publish

    Collaborators

    • tequilaz