Nightingale Posing Mischievously

    linshu-xpz

    1.0.1 • Public • Published

    安装

    npm install linshu-xpz
    

    导入

    const linshu = require('linshu-xpz');
    

    功能

    //格式化时间:调用dateFormat()方法
    const date = linshu.dateFormat(new Date());
    console.log(date);
    
    //转义HTML中的特殊字符:调用htmlReplace()方法
    const strhtml = '<h3>"少年郎&|</h3>';
    const str = linshu.htmlReplace(strhtml);
    console.log(str);
    
    //将特殊字符转义为HTML:调用htmlRestore()方法
    const strhtml = '&lt;h3&gt;&quot;少年郎&amp;|&lt;/h3&gt;';
    const str2 = linshu.htmlRestore(strhtml);
    console.log(str2)
    

    开源协议

    ISC

    Install

    npm i linshu-xpz

    DownloadsWeekly Downloads

    1

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    1.96 kB

    Total Files

    5

    Last publish

    Collaborators

    • xiaopingzi