1.0.0 • Published 3 years ago

timergo v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

安装

npm install timergo

导入

const timergo = require('index')

格式化时间

// 调用dateFormat函数对时间进行格式化
let td = timergo.dateFormat(new Date())
console.log(td)

转义HTML中的特殊字符

// 待转换的字符串
let htmlstr = '<h1 style = "color:red;">您好</h1>'
// 调换htmlEscape函数进行转义
let str = timergo.htmlEscape(htmlstr)
console.log(str)

还原HTML中的特殊字符

const str2 = timergo.htmlUnEscape(str)
console.log(str2)

开源协议

ISC