# @wonkledge/httpcode

Latest version **1.0.4** (published 2021-04-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @wonkledge/httpcode
pnpm add @wonkledge/httpcode
yarn add @wonkledge/httpcode
bun add @wonkledge/httpcode
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2021-04-29 |
| First published | 2021-04-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 12 |
| Unpacked size | 26.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | wonkledge |
| Keywords | enums, enumeration, http, http code, convention |

## Links

- npm: https://www.npmjs.com/package/@wonkledge/httpcode
- Repository: https://github.com/wonkledge/httpcode
- Homepage: https://github.com/wonkledge/httpcode#readme
- Issues: https://github.com/wonkledge/httpcode/issues
- npm.io page: https://npm.io/package/@wonkledge/httpcode

## Dependencies (12)

- [jest](https://npm.io/package/jest.md) ^26.6.3
- [eslint](https://npm.io/package/eslint.md) ^7.23.0
- [ts-jest](https://npm.io/package/ts-jest.md) ^26.5.4
- [typescript](https://npm.io/package/typescript.md) ^4.2.4
- [@types/jest](https://npm.io/package/@types/jest.md) ^26.0.22
- [@types/node](https://npm.io/package/@types/node.md) ^14.14.37
- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) ^7.20.3
- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) ^2.22.0
- [eslint-plugin-jsx-a11y](https://npm.io/package/eslint-plugin-jsx-a11y.md) ^6.3.1
- [eslint-plugin-react-hooks](https://npm.io/package/eslint-plugin-react-hooks.md) ^4.0.8
- [eslint-config-airbnb-typescript](https://npm.io/package/eslint-config-airbnb-typescript.md) ^12.3.1
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) ^4.4.1

## Recent versions

- 1.0.4 (latest) — 2021-04-29
- 1.0.3 — 2021-04-29
- 1.0.2 — 2021-04-29
- 1.0.1 — 2021-04-29
- 1.0.0 — 2021-04-29

## README

# httpcode



httpcode is a small library to handle http code status convention.



### HTTP Code enumerations

​	`HTTP_CODE_INFORMATION` contains all http code 1xx

​	`HTTP_CODE_SUCCESS` contains all http code 2xx

​	`HTTP_CODE_REDIRECTION` contains all http code 3xx

​	`HTTP_CODE_CLIENT_ERROR` contains all http code 4xx

​	`HTTP_CODE_SERVER_ERROR` contains all http code 5xx

​	`HTTP_CODE` contains all http code



### HTTP Code type

​	`HTTPCodeInformation`

​	`HTTPCodeSuccess`

​	`	HTTPCodeRedirection`

​	`HTTPCodeClientError`

​	`	HTTPCodeServerError`



### HTTP Code type guard

​	`isHttpCodeInformation :: (data: any) => data is HTTPCodeInformation`

​	`isHttpCodeSuccess :: (data: any) => data is HTTPCodeSuccess`

​	`	isHttpCodeRedirection :: (data: any) => data is HTTPCodeRedirection`

​	`	isHttpCodeClientError :: (data: any) => data is HTTPCodeClientError`

​	`isHttpCodeServerError :: (data: any) => data is HTTPCodeServerError`



### Example 

#### 	Type guard

​		`isHttpCodeInformation(HTTP_CODE.OK)// returns false` 

​		`isHttpCodeInformation(HTTP_CODE.PROCESSING) // returns true`

#### 	Http code

​		`const myHttpCode = HTTP_CODE.OK // 200`

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