itheima-tools-shr
v1.0.1
Published
提供了格式化时间,HTMLEscape相关的功能
Downloads
5
Readme
安装
npm install itheima-tools-shr
导入
const itheima = require('itheima-tools-shr')
格式化时间
// 调用dateFormat 对时间进行格式化
const dtStr = itheima.dateFormat(new Date())
console.log(dtStr);
转义
const str = '<span>我是一段测试文字</span>'
const newStr = itheima.htmlEscape(str)
console.log(newStr);
开源协议
ISC