1.0.0 • Published 2 years ago
itheima-tools-beta v1.0.0
安装
npm install itheima-tools-beta
导入
const itheima = require('itheima-tools-beta')
格式化时间
const date = new Date()
console.log(itheima.dateformat(date))
转义html
const htmlStr = '<h1 style="display: block">这是一个h1标签</h1>'
console.log(itheima.htmlEscape(htmlStr))
反转义html
const str = itheima.htmlEscape(htmlStr)
console.log(itheima.htmlUnEscape(str))
1.0.0
2 years ago