# status-codes

> Return HTTP Status Codes with name and message

Latest version **0.0.1** (published 2015-03-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install status-codes
pnpm add status-codes
yarn add status-codes
bun add status-codes
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2015-03-26 |
| First published | 2015-03-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Darren Labithiotis |
| Maintainers | labithiotis |
| Keywords | http, status, code, error, statuscodes |

## Links

- npm: https://www.npmjs.com/package/status-codes
- Repository: https://github.com/labithiotis/status-codes
- Issues: https://github.com/labithiotis/status-codes/issues
- npm.io page: https://npm.io/package/status-codes

## 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

- 0.0.1 (latest) — 2015-03-26

## README

# status-codes

  [![NPM Version][npm-image]][npm-url]
  [![NPM Downloads][downloads-image]][downloads-url]

Small module to return all known HTTP status with a name and brief description.

## Installation

```bash
$ npm install status-codes --save
```
## Using

All codes from this [Wiki HTTP Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)

```javascript
    
    var statusCodes = require('status-codes');

	statusCodes[404];
		
	/** 
	
	Returns:
	
	{
		"status": 404,
		"name": "Not Found",
		"message": "The server has not found anything matching the Request-URI."
	}
	
	**/
	
	// OR use a get method that has a fallback to a code 400 if it doesn't find a valid code
	
	statusCodes.get(536727);
	
	/** 
	
	Returns:
	
	{
		"status": 400,
		"name": "Bad Request",
		"message": "The server cannot or will not process the request."
	}
	
	**/

```

## Constants

Can retrive HTTP status by name too:

```javascript

	statusCodes.NOT_FOUND;
		
	/** 
	
	Returns:
	
	{
		"status": 404,
		"name": "Not Found",
		"message": "The server has not found anything matching the Request-URI."
	}
	
	**/

```

[npm-image]: https://img.shields.io/npm/v/status-codes.svg?style=flat
[npm-url]: https://npmjs.org/package/status-codes
[downloads-image]: https://img.shields.io/npm/dm/status-codes.svg?style=flat
[downloads-url]: https://npmjs.org/package/status-codes
[travis-image]: https://img.shields.io/travis/strongloop/status-codes.svg?style=flat
[travis-url]: https://travis-ci.org/strongloop/status-codes
[coveralls-image]: https://img.shields.io/coveralls/strongloop/status-codes?style=flat
[coveralls-url]: https://coveralls.io/r/strongloop/status-codes?branch=master

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