# itheima-tools-zzy

> ``` npm i itheima-tools-zzy ``` ##导入 ```js const itheima = require('./itheima-tools-zzy')

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

## Install

```sh
npm install itheima-tools-zzy
pnpm add itheima-tools-zzy
yarn add itheima-tools-zzy
bun add itheima-tools-zzy
```

## 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-09-02 |
| First published | 2022-09-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | 3297095636npm |

## Links

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

## Recent versions

- 1.0.0 (latest) — 2022-09-02

## README

## 安装
```
npm i itheima-tools-zzy
```
##导入
```js
const itheima = require('./itheima-tools-zzy')

```

## 格式化时间
```js
//调用dateFrom 对时间进行格式化
const dtStr = itheima.dateFrom(new Date())
// 结果 2022-09-01 22:35:17
console.log(dtStr)
```
## 转移HTML 中的特殊字符
```js
//待转化的HTML字符串
const htmlStr = `<h1 title="abc">这是H1标签<span>123&nbsp;</span></h1>`
//调用htmlEscape方法进行转化
const str = itheima.htmlEscape(htmlStr)
//转化结果 &lth1 title=&quotabc&quot&lg这是H1标签&ltspan&lg123&ampnbsp;&lt/span&lg&lt/h1&lg   
console.log(str)
```
## 还原HTML中的字符串
```js
//带还原的HTML字符串
const ss = `&lth1 title=&quotabc&quot&lg这是H1标签&ltspan&lg123&ampnbsp;&lt/span&lg&lt/h1&lg `
//调用expStr方法
const sn = itheima.expStr(ss)
//结果 <h1 title="abc">这是H1标签<span>123&nbsp;</span></h1>
console.log(sn)
```

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