itheima-tools-zwh

1.0.1 • Public • Published

##安装

npm install itheima-tools-zs

##导入

const itheima = require('itheima-tools-zwh')

##格式化时间

const dtStr = itheima.dateFormat(new Date())
console.log(dtStr)

##转义html字符串

// <h1 title="abc">这是一个标签 </h1>
const htmlStr = '<h1 title="abc">这是一个标签&nbsp;</h1>';
console.log(itheima.htmlEscape(htmlStr))

##还原html字符串

// <h1 title="abc">这是一个标签&nbsp;</h1>
const str1 = itheima.htmlEscape(htmlStr);
console.log(itheima.htmlUnEscape(str1))

##开源协议 ISC

/itheima-tools-zwh/

    Package Sidebar

    Install

    npm i itheima-tools-zwh

    Weekly Downloads

    0

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    2.84 kB

    Total Files

    5

    Last publish

    Collaborators

    • laowenjiu