1.0.0 • Published 12 months ago
sallyit v1.0.0
##//安装方式 ''' npm install sallyit ''' ##//导入方式 '''js const index = require('sallyit') '''
##//格式化时间 '''js //调用dateFormat对时间进行格式化 const dt = index1.dateFormat(new Date()) console.log(dt); '''
##//转移HTML中的特殊字符 '''js //待转换的HTML字符串 const htmlStr ='这是h1标签123 ' //调用htmlEscape方法进行转换 const str= index1.htmlEscape(htmlStr) //结果<h1 title="abc">这是h1标签<span>123 </span></h1> console.log(str) '''
##//还原HTML中的特殊字符 '''js //待还原的HTML字符串 const str1 =index1.htmlunEscape(str) //输出结果这是h1标签123 console.log(str1) ##//开源协议 ISC
1.0.0
12 months ago