1.0.0 • Published 2 years ago

zypitheimass v1.0.0

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

##安装

npm install zypitheima

##导入

const itheima = require('zypitheima')

##格式化时间

//调用datefoemat对随时间进行格式化
const time = sm.dateformat(new Date())
//结果为 2022-02-15 21:18:30
console.log(time)

##转义html中的特殊字符

//待转换的html字符串
const zf = '<h1 style="">这是一个h1标签<apan>&</span></h1>'
//调用htmlespace方法
const str1 = sm.htmlescape(zf)
//转换的结果
console.log(str1)

##还原html中的字符

//待还原的字符串
const str2 = sm.htmlunescape(str1)
//转换的结果
console.log(str2)

##开源的协议

ISC