Package Exports
- rg-tools
- rg-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 (rg-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 rg-tools导入
const rango = require('rg-tools')格式化时间
// 调用 dateFormat 对时间进行格式化
let getTime = getDate.dateFormat(new Date())
// 打印结果
console.log(getTime) // 2023-04-11 20:08:55转义 HTML 中的特殊字符
// 需转义的 HTML 字符串
let htmlStr = '<a href="#">链接标签</a>'
// 调用 htmlEscape 方法进行转义
let getStr = getDate.htmlEscape(htmlStr)
// 打印结果
console.log(getStr) // <a href="#">链接标签</a>还原 HTML 中的特殊字符
// 调用 htmlEscape 方法进行还原
let unStr = getDate.htmlUnEscape(getStr)
// 打印结果
console.log(getStr) // <a href="#">链接标签</a>开源协议
ISC