# itheima-36cabbage

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

Latest version **1.0.0** (published 2021-03-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install itheima-36cabbage
pnpm add itheima-36cabbage
yarn add itheima-36cabbage
bun add itheima-36cabbage
```

## 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 | 2021-03-07 |
| First published | 2021-03-07 |
| 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 | cabbage258 |
| Keywords | itheima, dateFormat, HTMLEscape |

## Links

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

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2021-03-07

## README

## 安装
```
npm install itheima-36cabbage
```
## 导入
```
const tools = require('itheima-36cabbage')
```
## 格式化时间
```
//调用 dateFormate对时间进行格式化
const dtStr = tools.dateFormat(new Date())
//结果 2016-04-03 20:39:54
console.log(dtStr)
```
## 转义HTML中的特殊字符
```
//待转换的HTML字符串
const htmlStr = '<h1 title='203954'>S6第一个王者<span>203954 </span></h1>'
//调用htmlEscape方法进行转换
const str = tools.htmlEscape(thmlStr)
//转换的结果 <h1 title='203954'>S6第一个王者<span>203954&nbsp;</span></h1>
console.log(str)
```
## 还原HTML中的特殊字符
```
//待还原的HTML字符串
const str2 = tools.htmlUnEscape(str)
//输出的结果 <h1 title='203954'>S6第一个王者<span>203954 </span></h1>
console.log(str2)
```

## 开源协议
#### **ISC**

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