JSPM

hua-tools

1.1.1
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 1
    • Score
      100M100P100Q12111F
    • License ISC

    提供时间格式化,转译html文件功能

    Package Exports

    • hua-tools
    • hua-tools/index.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hua-tools) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    安装

    npm install hua-tools

    导入

    const hua = require('hua-tools')

    时间格式化

    //引用时间格式化函数
    const newDt = hua.dataFormat(new Date())
    console.log(newDt);
    // 结果为 2023-05-26 11:10:26

    转义HEML特殊字符

    const str = '<h1>我是一个天才啊</h1>'
    const escapeStr = hua.htmlEscape(str)
    console.log(escapeStr);
    // 结果为&lt;h1&gt;我是一个天才啊&lt;/h1&gt;

    还原HTML特殊字符

    const str2 = hua.htmlUnEscape(escapeStr)
    console.log(str2);
    // 结果为<h1>我是一个天才啊</h1>

    开源协议

    ISC