1.1.0 • Published 2 years ago
itheima-tools-babamama v1.1.0
安装
... npm install heima-tools ...
导入
...js const heima = require('heima-tools'); ...
格式化时间
...js 调用格式化时间的方法 const times = heima.dataFormat(new Date()); console.log(times); ...
转义 HTML 中的特殊字符
...js // 调用转义 HTML 的方法 const htmlStr = '这是h1标签' const hs = heima.htmlEscaped(htmlStr); console.log(hs); ...
还原 HTML 中的特殊字符
...js // 调用还原字符串的方法 const hy = heima.htmlUnEscaped(htmlStr) console.log(hy); ...
开源协议
ISC
1.1.0
2 years ago