Package Exports
- xiaolin-tools
- xiaolin-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 (xiaolin-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 xiaolin-tools导入
const xiaolin = require('xiaolin-tools')格式化时间
// 格式化时间的功能
const n = xiaolin.dateFormat(new Date())
// 结果 2022-10-08 20:49:32
console.log(n)转义html
const htmlStr = '<h1>这是h1标 签</h1>'
const str = xiaolin.htmlEscape(htmlStr)
// 结果 <h1>这是h1标 签</h1>
console.log(str)还原html
const htmlStr2 = '<h1>这是h1标签</h1>'
const str2 = xiaolin.htmlUnEscape(htmlStr2)
// 结果 <h1>这是h1标签</h1>
console.log(str2)
开源协议
ISC