1.0.0 • Published 2 years ago
sheep-tools v1.0.0
安装
npm install sheep-tools
导入
const sheep = require('sheep-tools')
格式化时间
//调用dateFormat对时间进行格式化
const dtStr = sheep.dateFormat(new Date())
console.log(dtStr)
转义HTML特殊字符
const htmlStr = '<h1 style = "width: 20px">hello</h1>'
const str = sheep.htmlEscape(htmlStr)
console.log(str)
还原HTML特殊字符
const htmlStr2 = '<h1 style = "width: 20px">hello</h1>'
const str2 = sheep.htmlUnEscape(htmlStr2)
console.log(str2)
开源协议
ISC
1.0.0
2 years ago