itheima-tools-beta
v1.0.0
Published
提供了格式化时间,HTMLEscape的功能
Downloads
3
Readme
安装
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))