1.0.0 • Published 1 year ago

mypackege-utils-sjx v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

介绍

这是一个工具包,可以格式化时间,转义HTML中的特殊字符,还原HTML中的特殊字符

安装方式

nmp i mypackege-utils-sjx

导入方法

let test = require("./index")

格式化时间

let now = new Date()
let time = test.dateFormat(now)
console.log(time)

转义HTML中的特殊字符

let html = '<h3 class="color">标题  &nbsp;</h3>'
let title1 = test.htmlReplace(html)
console.log(title1)

还原HTML中的特殊字符

let str = '<h3 class="color">标题  &nbsp;</h3>'
let title2 = test.strReplace(str)
console.log(title2)

开源协议

ISC

1.0.0

1 year ago