itheima-tools-jzh123

1.0.0 • Public • Published

安装

npm install itheima-tools-jzh

导入

const itheima = require("./index.js");

格式化时间

// 调用dateFormat对时间进行格式化
let dataStr = date.dateFormat(new Date());
console.log(dataStr); //结果

转义 HTML 中的特殊字符

// 调用escapeHTML对字符串进行转义
let str = "<h1>hello</h1>";
let result = itheima.htmlEscape(str);
console.log(result); //结果

还原 HTML 中的特殊字符

let htmlStr = "<h1>hello</h1>";
let htmlResult = itheima.htmlUnEscape(htmlStr);
console.log(htmlResult); //结果

开源协议

ISC

Readme

Keywords

Package Sidebar

Install

npm i itheima-tools-jzh123

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

2.36 kB

Total Files

5

Last publish

Collaborators

  • juzihang