# http-status-error

> Create errors using an HTTP status

Latest version **1.1.1** (published 2015-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install http-status-error
pnpm add http-status-error
yarn add http-status-error
bun add http-status-error
```

## 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.1 |
| Published | 2015-09-15 |
| First published | 2015-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ben Drucker |
| Maintainers | bendrucker |
| Keywords | http, status, code, error |

## Links

- npm: https://www.npmjs.com/package/http-status-error
- Repository: https://github.com/bendrucker/http-status-error
- Homepage: https://github.com/bendrucker/http-status-error#readme
- Issues: https://github.com/bendrucker/http-status-error/issues
- npm.io page: https://npm.io/package/http-status-error

## Dependencies (3)

- [assert-ok](https://npm.io/package/assert-ok.md) ~1.0.0
- [is-error-code](https://npm.io/package/is-error-code.md) ~1.0.0
- [builtin-status-codes](https://npm.io/package/builtin-status-codes.md) ~1.0.0

## 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.1.1 (latest) — 2015-09-15
- 1.1.0 — 2015-09-12
- 1.0.0 — 2015-09-07

## README

# http-status-error [![Build Status](https://travis-ci.org/bendrucker/http-status-error.svg?branch=master)](https://travis-ci.org/bendrucker/http-status-error)

> Create errors using an HTTP status


## Install

```
$ npm install --save http-status-error
```


## Usage

```js
var httpStatusError = require('http-status-error')

httpStatusError(200)
//=> null

httpStatusError(404)
//=> err.message => "Not Found (404)"
//=> err.statusCode => 404
```

## API

#### `httpStatusError(code)` -> `null` / `error`

##### input

*Required*  
Type: `number`

An HTTP status code.


## License

MIT © [Ben Drucker](http://bendrucker.me)

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