# zls-utils

> 提供格式化时间、HTMLEscape相关功能

Latest version **1.0.2** (published 2022-04-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install zls-utils
pnpm add zls-utils
yarn add zls-utils
bun add zls-utils
```

## 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.2 |
| Published | 2022-04-08 |
| First published | 2022-04-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | zenglongsheng |
| Keywords | zls-utils, format, escape |

## Links

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

## 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.2 (latest) — 2022-04-08
- 1.0.1 — 2022-04-08
- 1.0.0 — 2022-04-08

## README

## 安装
```
npm install zls-utils
```

## 导入
```js
const zlsUtils = require('zls-utils')
```

## 格式化时间
```js
// 调用格式化时间的方法
const dateStr = zlsUtils.format(new Date())
// 结果 2022-04-08 10:00:59
console.log(dateStr)
```

## 转义HTML中特殊字符
```js
const htmlStr = '<h1>你电话手机打开反对法<span>豆腐干地方&nbsp;</span>永远都是</h1>'
// 调用转义html特殊字符的方法
const str = zlsUtils.htmlEscape(htmlStr)
// 转化结果 &lt;h1&gt;你电话手机打开反对法&lt;span&gt;豆腐干地方&amp;nbsp;&lt;/span&gt;永远都是&lt;/h1&gt;
console.log(str)
```

## 还原html的特殊字符串
```js
// 调用还原html特殊字符的方法
const unHtmlStr = zlsUtils.htmlUnEscape(str)
// 还原结果 <h1>你电话手机打开反对法<span>豆腐干地方&nbsp;</span>永远都是</h1>'
console.log(unHtmlStr)
```

## 开源协议
ISC

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