1.0.1 • Published 2 years ago

itheima-tools-zwh v1.0.1

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

##安装

npm install itheima-tools-zs

##导入

const itheima = require('itheima-tools-zwh')

##格式化时间

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

##转义html字符串

// <h1 title="abc">这是一个标签 </h1>
const htmlStr = '<h1 title="abc">这是一个标签&nbsp;</h1>';
console.log(itheima.htmlEscape(htmlStr))

##还原html字符串

// <h1 title="abc">这是一个标签&nbsp;</h1>
const str1 = itheima.htmlEscape(htmlStr);
console.log(itheima.htmlUnEscape(str1))

##开源协议 ISC