# itheima-hz

> 提供了卓卓的代码

Latest version **1.0.0** (published 2022-02-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install itheima-hz
pnpm add itheima-hz
yarn add itheima-hz
bun add itheima-hz
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-02-23 |
| First published | 2022-02-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | hzgoodgood |
| Keywords | itheima, hz |

## Links

- npm: https://www.npmjs.com/package/itheima-hz
- npm.io page: https://npm.io/package/itheima-hz

## Dependencies (2)

- [g](https://npm.io/package/g.md) ^2.0.1
- [npm](https://npm.io/package/npm.md) ^8.5.1

## Recent versions

- 1.0.0 (latest) — 2022-02-23

## README

## 安装
、、、
npm install itheima-hz
、、、

## 导入
、、、
const itheima = require('itheima-tools')
、、、

##格式化时间
、、、
// 调用函数对时间进行格式化
const dtStr = itheima.dataFormat(new Date())
console.log(dtStr);
、、、

## 转义 HTML 中的特殊字符
、、、
// 待转换的 HTML 字符串
const htmlstr = '<h1 title="abc>这是h1标签<span>123&nbsp</span></h1>'
// 调用 htmlEscape 方法进行转换
const str = itheima.htmlEscape(htmlstr)
// 转换结果 &lt;h1 title=&quotabc&gt;这是h1标签&lt;span&gt;123&ampnbsp&lt;/span&gt;&lt;/h1&gt;
console.log(str)
、、、
## 还原 HTML 中的特殊字符
、、、
// 待转换的 HTML 字符串
const htmlstr = '&lt;h1 title=&quotabc&gt;这是h1标签&lt;span&gt;123&ampnbsp&lt;/span&gt;&lt;/h1&gt;'
// 调用 htmlUnEscape 方法进行转换
const str = itheima.htmlUnEscape(htmlstr)
// <h1 title=&quotabc>这是h1标签<span>123&ampnbsp</span></h1>
const str1 = itheima.htmlUnEscape(str)
、、、

### 开源协议
ISC

---
_Source: https://npm.io/package/itheima-hz · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
