# dispose-date-html

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

Latest version **1.0.1** (published 2023-09-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install dispose-date-html
pnpm add dispose-date-html
yarn add dispose-date-html
bun add dispose-date-html
```

## 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.1 |
| Published | 2023-09-14 |
| First published | 2023-09-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jiliuyongjin |
| Keywords | dispose-date-html, dateFormat, escape |

## Links

- npm: https://www.npmjs.com/package/dispose-date-html
- npm.io page: https://npm.io/package/dispose-date-html

## 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.1 (latest) — 2023-09-14

## README

## 安装
```js
npm install dispose-date-html

```

## 导入
```js
const disposeDateHtml = require('dispose-date-html')

```

## 使用时间格式化
``` js
// 调用 formatDate 函数，格式化时间
 let tm =   tool.formatDate(new Date())
 // 格式化时间的结果
 console.log('[ tm ] >', tm) // 2023-09-14 11-16-03

```

 ## 转义 html 特殊字符
 ``` js
 // 需要转义 html 特殊字符
 let  htmlStr='<h1 title="abc">这是h1标签<span>123&nbsp;</span></h1>'
 // 调用 htmlEscape 函数，转义 html 特殊字符
 let str = tool.htmlEscape(htmlStr)
 // 转义 html 特殊字符结果
 console.log('[ str ] >', str) // &lt;h1 title=&quot;abc&quot;&gt;这是h1标签&lt;span&gt;123&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;
```

 ## 还原 html 特殊字符
 ``` js
 // 调用 htmlUnEscape 函数，还原 html 转义符
 let str2 = tool.htmlUnEscape(htmlStr)
 // 还原  html 特殊字符
 console.log('[ str2 ] >', str2) // <h1 title="abc">这是h1标签<span>123&nbsp;</span></h1>
```

## 开源协议
ISC

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