1.0.0 • Published 2 years ago

itheima-tools-chenxb v1.0.0

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

安装

npm Install itheima-tools-chenxb

导入

const itheima = require('./itheima-tools-chenxb')

时间格式化

const dtStr = itheima.dateFormat(new Date())
console.log(dtStr)

转义HTML字符串

const htmlStr = '<h1 title="abc">h1</h1>'
const str = itheima.htmlEscape(htmlStr)
console.log(str)
const str1 = itheima.htmlUnEscape(str)
console.log(str1)