# gxww-tools

> 格式化时间、html相关的功能

Latest version **1.0.0** (published 2023-01-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install gxww-tools
pnpm add gxww-tools
yarn add gxww-tools
bun add gxww-tools
```

## 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-01-28 |
| First published | 2023-01-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | cnc14 |
| Keywords | gxw, cmd, yyl |

## Links

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

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-01-28

## README

## 安装
```
npm install gxw-tools
```

## 导入
```js
const gxw = require('./gxw-tools/index');
```

## 格式化时间
```js
// 调用 dateFormat 对时间进行格式化
const dtStr = gxw.dateFormat(new Date())
// 结果  2023-00-29 18:53:04
console.log(dtStr)
```

## 转义 HTML 中的特殊字符
```js
// 带转换的 HTML 字符串
const htmlStr = '<h1 title="abc">这是h1标签<span>123&nbsp;</span></h1>'
// 调用 htmlEscape 方法进行转换
const str = gxw.htmlEscape(htmlStr)
// 转换的结果 &lt;h1 title=&quot;abc&quot;&gt;这是h1标签&lt;span&gt;123&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;
console.log(str)
```

## 还原 HTML 中的特殊字符
```js
// 待还原的 HTML 字符串
const str2 = gxw.htmlUnEscape(str)
// 输出的结果 <h1 title="abc">这是h1标签<span>123&nbsp;</span></h1>
console.log(str2)
```

## 开源协议
ISC

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