# koa-statuscode-pikson

> for koa statucode

Latest version **1.0.0** (published 2019-12-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install koa-statuscode-pikson
pnpm add koa-statuscode-pikson
yarn add koa-statuscode-pikson
bun add koa-statuscode-pikson
```

## 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 | 2019-12-05 |
| First published | 2019-12-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | peterq |
| Maintainers | peterq |
| Keywords | errorcode |

## Links

- npm: https://www.npmjs.com/package/koa-statuscode-pikson
- Repository: https://github.com/piksonGit/statusCode
- Homepage: https://github.com/piksonGit/statusCode#readme
- Issues: https://github.com/piksonGit/statusCode/issues
- npm.io page: https://npm.io/package/koa-statuscode-pikson

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-12-05

## README

# statusCode
statusCode for koa


#### 一个通用的返回值对象
```
const statusCode = {
    success: {
      code: 0,
      desc: "success"
    },
    serverError: {
      code: -1,
      desc: "Internal Server Error"
    },
    notFound: {
      code: 1005,
      desc: "not found"
    },
    noPermission: {
      code: 1004,
      desc: "you don't have the permission"
    },
    alreadyExists: {
      code: 1006,
      desc: 'already exists',
    },
    lackOfParameters: {
      code: 1003,
      desc: 'lack of parameters or invaild parameters',
    },
  };

```

返回的是Object.assign 拷贝的对象，所以不用担心对象的引用传递问题

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