1.0.0 • Published 10 months ago
itheima-tools-zww v1.0.0
安装
npm i itheima-tools
导入
const itheima = require('itheima-tools')
格式化时间
// 调用dateFormat对时间进行格式化
const dtStr = itheima.dateFormat(new Date())
// 结果为2024-10-06 09:56:07
console.log(dtStr)
转换 html 字符串
// 定义内容,调用方法传入,控制台输出
console.log(itheima.htmlEscape('<div class="box">'))
还原 html 字符串
// 定义内容,调用方法传入,控制台输出
console.log(itheima.htmlUnEscape('<div class="box">'))
开源协议
ISC
1.0.0
10 months ago