sheep-tools

1.0.0 • Public • Published

安装

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 = '&lt;h1 style = &quot;width: 20px&quot;&gt;hello&lt;/h1&gt;'
const str2 = sheep.htmlUnEscape(htmlStr2)
console.log(str2)

开源协议

ISC

Readme

Keywords

Package Sidebar

Install

npm i sheep-tools

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

2.54 kB

Total Files

5

Last publish

Collaborators

  • sheep-yhx