# boom-to-json-api

> Formats a Boom error according to the JSON API spec

Latest version **1.0.0** (published 2015-12-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install boom-to-json-api
pnpm add boom-to-json-api
yarn add boom-to-json-api
bun add boom-to-json-api
```

## 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 | 2015-12-30 |
| First published | 2015-12-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.0.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | robin@robinmurphy.co.uk |
| Maintainers | robinmurphy |
| Keywords | boom, to, json, api, format |

## Links

- npm: https://www.npmjs.com/package/boom-to-json-api
- Repository: https://github.com/robinjmurphy/boom-to-json-api
- Homepage: https://github.com/robinjmurphy/boom-to-json-api#readme
- Issues: https://github.com/robinjmurphy/boom-to-json-api/issues
- npm.io page: https://npm.io/package/boom-to-json-api

## Dependencies (1)

- [boom](https://npm.io/package/boom.md) ^3.1.1

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-12-30

## README

# boom-to-json-api

[![Build Status](https://travis-ci.org/robinjmurphy/boom-to-json-api.svg)](https://travis-ci.org/robinjmurphy/boom-to-json-api)

> Formats a [Boom](https://github.com/hapijs/boom) error according to the [JSON API spec](http://jsonapi.org/format/#errors)

## Installation

```
npm install --save boom-to-json-api
```

## Usage

```js
const Boom = require('boom');
const convert = require('boom-to-json-api');

const err = Boom.notFound('Sorry, nothing to see here!');
const body = convert(err);

console.log(body);
// {
//   errors: [
//     {
//       status: '403',
//       title: 'Not Found',
//       detail: 'Sorry, nothing to see here!'
//     }
//   ]
// }
```

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