# wagu

> 自用

Latest version **1.0.0** (published 2023-07-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install wagu
pnpm add wagu
yarn add wagu
bun add wagu
```

## 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 | 2023-07-05 |
| First published | 2023-07-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | rihuowagu |
| Keywords | rihuowagu, wagu |

## Links

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

## Recent versions

- 1.0.0 (latest) — 2023-07-05

## README

## 安装
```
npm install wagu
```

## 导入
```js
const wagu = require('wagu')
```

## 格式化时间
``` js

// 调用times对时间格式化
const time = wagu.times(new Date())
console.log(time)
//结果 2023-07-05 17:20:31

```


## 转义 HTML 中的特殊字符
``` js
// 带转化的 HTML 字符串
const htmlStr = '<h1 title="abc">hello <span>123&nbsp;</span> </h1>'
// 调用htmlEscaape
console.log(wagu.htmlEscape(htmlStr))
// 转化的结果 &lt;h1 title=&quot;abc&quot;&gt;hello &lt;span&gt;123&amp;nbsp;&lt;/span&gt; &lt;/h1&gt; 
```

## 还原 HTML 中的特殊字符
``` js

// 待还原的html字符
console.log(wagu.htmlUnEscape(wagu.htmlEscape(htmlStr)))
// 输出的结果<h1 title="abc">hello <span>123&nbsp;</span> </h1>

```

## 开源协议
ISC

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