# http-error-stream

> Stream an error over http

Latest version **1.0.1** (published 2016-03-29) · MIT license · 0 weekly downloads

## Install

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

## 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.1 |
| Published | 2016-03-29 |
| First published | 2016-03-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | yoshuawuyts |
| Keywords | http, error, stream |

## Links

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

## Dependencies (2)

- [from2-string](https://npm.io/package/from2-string.md) ^1.1.0
- [readable-stream](https://npm.io/package/readable-stream.md) ^2.0.6

## 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.1 (latest) — 2016-03-29

## README

# http-error-stream [![stability][1]][1]
[![npm version][2]][3] [![build status][4]][5] [![test coverage][6]][7]
[![downloads][8]][9] [![js-standard-style][10]][11]

Stream an error over http. Takes a `server-error` error and streams it back
out.

## Usage
```js
const errorStream = require('http-error-stream')
const serverError = require('server-error')
const bole = require('bole')
const http = require('http')

const log = bole('my-service')
const error = serverError(log)

http.createServer(function (req, res) {
  const err = error.client('oh no!')
  // set statusCode, content-type and stream error as JSON
  errorStream(req, res, err).pipe(res)
}).listen
```

## Installation
```sh
$ npm install http-error-stream
```

## License
[MIT](https://tldrlegal.com/license/mit-license)

[0]: https://img.shields.io/badge/stability-experimental-orange.svg?style=flat-square
[1]: https://nodejs.org/api/documentation.html#documentation_stability_index
[2]: https://img.shields.io/npm/v/http-error-stream.svg?style=flat-square
[3]: https://npmjs.org/package/http-error-stream
[4]: https://img.shields.io/travis/yoshuawuyts/http-error-stream/master.svg?style=flat-square
[5]: https://travis-ci.org/yoshuawuyts/http-error-stream
[6]: https://img.shields.io/codecov/c/github/yoshuawuyts/http-error-stream/master.svg?style=flat-square
[7]: https://codecov.io/github/yoshuawuyts/http-error-stream
[8]: http://img.shields.io/npm/dm/http-error-stream.svg?style=flat-square
[9]: https://npmjs.org/package/http-error-stream
[10]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[11]: https://github.com/feross/standard

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