# czp-utils

> 常用的优雅工具函数

Latest version **1.1.2** (published 2022-03-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install czp-utils
pnpm add czp-utils
yarn add czp-utils
bun add czp-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.1.2 |
| Published | 2022-03-30 |
| First published | 2022-03-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | czp |
| Maintainers | zpglmc |
| Keywords | utils |

## Links

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

## Recent versions

- 1.1.2 (latest) — 2022-03-30
- 1.1.1 — 2022-03-30
- 1.1.0 — 2022-03-30
- 1.0.3 — 2022-03-29
- 1.0.2 — 2022-03-29
- 1.0.1 — 2022-03-29
- 1.0.0 — 2022-03-29

## README

# introduce
  提供一些公共方法：防抖、节流、深拷贝、自定义事件总线、获取页面 url 全部参数、身份证校验、获取当前年月日、格式化资金数字

# install
  ```shell
  npm install czp-utils
  ```

  # usage
  ```shell
  import { axiosWrapper } from 'czp-utils'

  const fn = async () => {
    // 业务1 使用err判断
    const { err, res } = await axiosWrapper(Axios.get('xxx1'));
    if (err) {
        alert(err);
    } else {
        console.log(res);
    }
    // 业务2 使用res判断  使用这种判断的时候注意你的返回结果是不是有为null的时候
    const { err, res } = await toAsyncAwait(Axios.get('xxx2'));
    if (res) {
        console.log(res);
    } else {
        alert(err);
    }
    // 业务三不管错误
    const { res } = await toAsyncAwait(Axios.get('xxx3'));
    if (res) {
        console.log(res);
    }
  }
  ```

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