1.0.0 • Published 2 years ago

itheima-tools-beta v1.0.0

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

安装

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))