# itheima-tools-chenyuanyuan

> 提供了格式化时间， HTMLEscape的功能

Latest version **1.0.0** (published 2022-10-18) · ISC license · 0 weekly downloads

## Install

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

## 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-10-18 |
| First published | 2022-10-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | robertspa |
| Maintainers | robertspa |
| Keywords | itheima, dateFormat, escape |

## Links

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

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-10-18

## README

## 安裝
```
npm install itheima-tools
```

## 導入
```
const itheima = require('itheima-tools');
```

## 格式化時間
```
// 調用 dateFormat 對時間進行格式化
const dt = itheima.dateFormat(new Date());
// 2022-10-18 15:40:04
console.log(dt);
```

## 轉義 HTML 中的特殊字符
```
// 調用 htmlEscape 對HTML字符串進行轉義
const htmlStr = itheima.htmlEscape('<h1 title="abc">hello motor<span>123&nbsp;</span></h1>');
// 轉換結果：&lt;h1 title=&quot;abc&quot;&gt;hello motor&lt;span&gt;123&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;
console.log(htmlStr);
```

## 還原HTML的字符轉義
```
// 調用 htmlUnEscape 還原HTML的字符轉義
const rawStr = itheima.htmlUnEscape(htmlStr);
// 還原結果：<h1 title="abc">hello motor<span>123&nbsp;</span></h1>
console.log(rawStr);
```

## 開源協議
ISC

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