1.0.0 • Published 1 year ago

chishiheniao v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

安装

npm install chishiheniao

导入

const main = require("chishiheniao")

格式化时间

const date = main.Format(new Date());
console.log(datte)

转义HTML中的特殊字符

// 待转换的HTML字符串
const htmlStr = "<h1>我是一个屎</h1>";
// 调用将HTML字符串转义
const av = main.htmlEscape(htmlStr);
// 输出转换结果 &lt;h1&gt;我是一个屎&lt;/h1&gt;
console.log(`转义之后的字符串是:${av}`)  

还原HTML中的特殊字符

// 还原html字符串 htmlStr : 需要还原的HTML字符串
console.log(`还原HTML字符串操作 ${main.htmlUnEscape(htmlStr)}`)

开源协议

ISC