# jsh-utils

> 提供格式化时间、转义及还原html中的特殊字符相关功能

Latest version **1.0.0** (published 2021-11-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install jsh-utils
pnpm add jsh-utils
yarn add jsh-utils
bun add jsh-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.0 |
| Published | 2021-11-06 |
| First published | 2021-11-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Joey |
| Maintainers | front-jsh |
| Keywords | jsh-utils, dateFormat, escape |

## Links

- npm: https://www.npmjs.com/package/jsh-utils
- npm.io page: https://npm.io/package/jsh-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.0 (latest) — 2021-11-06

## README

## 安装
```
npm install jsh-utils
```

## 导入
```js
const j = require('jsh-utils')
```

## 格式化时间
```js
//调用dateFormat对时间进行格式化
const currentDate = new Date()
const dateStr = j.dateFormat(currentDate)
console.log(dateStr)
```

## 转义html中的特殊字符
```js
// 待转换的html字符串
const htmlStr = '<h1 title="标题">Hello JSH</h1>'
// 调用htmlEscape方法进行转换
const escapeStr = j.htmlEscape(htmlStr)
// 转换结果 &lt;h1 title=&quot;标题&quot;&gt;Hello JSH&lt;/h1&gt;
console.log(escapeStr);
```

## 还原html中的特殊字符
```js
// 调用htmlUnEscape方法进行还原
const unescapeStr = j.htmlUnEscape(escapeStr)
// 还原结果 <h1 title="标题">Hello JSH</h1>
console.log(unescapeStr);
```

## 开源协议
ISC

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