1.0.0 • Published 3 years ago
itheima-tools-ding v1.0.0
包的说明文档 安装方式、导入方式、格式化时间、转义 HTML 中的特殊字符、还原 HTML 中的特殊字符、开源协议 package.json包管理配置文件 ##安装
npm install itheima-tools-karry
##导入
const itheima =require('itheima-tools')
##格式化时间
const dtStr=itheima.dateFormat(new Date())
console.log(dtStr) //2021-10-19 10:30:29
##转义HTML中特殊字符
const htmlStr='<h1>Hi<span> </span></h1>'
//调用htmlEscape方法进行转换
const str = itheima.htmlEscape(htmlStr)
//转换结果
console.log(str)
##还原HTML中特殊字符
//待还原的HTML字符串
const str2 =itheima.htmlUnEscape(str)
console.log(str2)
##开源协议 ISC
1.0.0
3 years ago