1.0.1 • Published 2 years ago

itheima-hhm-tool v1.0.1

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

readme

安装

npm install itheima-hhm-tool

导入

const itheima = require('../itheima-hhm-tool/index.js')

使用方法

//格式化时间
const dtstr= itheima.dateFormat(new Date())
console.log(dtstr);
//转义html
const htmlStr = '<h1 title="abc">我是测试<span>123&nbsp;</span></h1>'
const str = itheima.htmlEscape(htmlStr)
console.log(str);
//还原html的方法
const str2 = itheima.htmlUnEscape(htmlStr)
console.log(str2);

开源协议

ISC