itheima-tools-hey

1.0.0 • Public • Published

安装

npm install itheima-tools-hey

导入

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

格式化时间

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

转移html中的特殊字符

const htmlStr='<h1 title="abc">h1标签&nbsp;</h1>';
const str=itheima.htmlEscape(htmlStr);
//转换结果&lt;h1 title=&quot;abc&quot;&gt;h1标签&amp;nbsp;&lt;/h1&gt;  

还远html中的特殊字符

const str2= itheima.htmlUnEscape(str);
console.log(str2);
//<h1 title="abc">h1标签&nbsp;</h1>  

开源协议ISC

/itheima-tools-hey/

    Package Sidebar

    Install

    npm i itheima-tools-hey

    Weekly Downloads

    0

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    2.12 kB

    Total Files

    5

    Last publish

    Collaborators

    • heyi666