{"_id":"api-error-handler","_rev":"7-b2a5c2e30684848f64525aba03b5912e","name":"api-error-handler","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"api-error-handler","version":"1.0.0","keywords":["express","error","handler","api","json"],"author":{"url":"http://jongleberry.com","name":"Jonathan Ong","email":"me@jongleberry.com"},"license":"MIT","_id":"api-error-handler@1.0.0","maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"homepage":"https://github.com/expressjs/api-error-handler","bugs":{"url":"https://github.com/expressjs/api-error-handler/issues"},"dist":{"shasum":"304403d7f2975473b9e4b79a03dfb8fffd5ac561","tarball":"https://registry.npmjs.org/api-error-handler/-/api-error-handler-1.0.0.tgz","integrity":"sha512-MYtVgPS4zvyixBejpjlr7D1v/RLggk7h5GOgs8PvoXcnkXIgYvdLoA2oR4dWUoIABgQSfdled4DmTubGyf4ndg==","signatures":[{"sig":"MEQCIAm0Y1qcndxXsWYR/5/HT1HcKOb0FEME+BDaUtpRJU90AiBY8K1zv/+Tf0cIRLEP85wcYbiUFrG1A83MBEHb4E64oA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","files":["index.js"],"_shasum":"304403d7f2975473b9e4b79a03dfb8fffd5ac561","gitHead":"df765a50c0c1de4fdbe4ce9cef2d910df4d8ba3e","scripts":{"test":"mocha --reporter spec","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"repository":{"url":"https://github.com/expressjs/api-error-handler","type":"git"},"_npmVersion":"2.1.10","description":"Express error handlers for JSON APIs","_nodeVersion":"0.10.33","dependencies":{"statuses":"^1.2.0"},"devDependencies":{"mocha":"2","express":"^4.10.4","istanbul":"0","supertest":"^0.15.0","http-errors":"^1.2.8"},"directories":{}}},"time":{"created":"2014-12-10T21:21:07.802Z","modified":"2025-05-20T17:14:52.505Z","1.0.0":"2014-12-10T21:21:07.802Z"},"bugs":{"url":"https://github.com/expressjs/api-error-handler/issues"},"author":{"url":"http://jongleberry.com","name":"Jonathan Ong","email":"me@jongleberry.com"},"license":"MIT","homepage":"https://github.com/expressjs/api-error-handler","keywords":["express","error","handler","api","json"],"repository":{"url":"https://github.com/expressjs/api-error-handler","type":"git"},"description":"Express error handlers for JSON APIs","maintainers":[{"email":"jonathanrichardong@gmail.com","name":"jongleberry"},{"email":"ljharb@gmail.com","name":"ljharb"}],"readme":"\n# api-error-handler\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![Dependency Status][david-image]][david-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n[![Gittip][gittip-image]][gittip-url]\n\nAn error handler for JSON APIs, meant to be used with [http-errors](https://github.com/jshttp/http-errors)-style errors.\n\n## Example\n\n```js\nvar errorHandler = require('api-error-handler');\n\nvar api = new express.Router();\napi.get('/users/:userid', function (req, res, next) {\n\n});\n\napi.use(errorHandler());\n\napp.use('/api', api);\n```\n\n## API\n\n### .use(errorHandler([options]))\n\nCurrently no options.\n\n### Errors\n\n4xx errors are exposed to the client.\nProperties exposed are:\n\n- `message`\n- `type`\n- `name`\n- `code`\n- `status`\n\n5xx errors are not exposed to the client.\nInstead, they are given a generic `message` as well as the `type`.\n\n[gitter-image]: https://badges.gitter.im/expressjs/api-error-handler.png\n[gitter-url]: https://gitter.im/expressjs/api-error-handler\n[npm-image]: https://img.shields.io/npm/v/api-error-handler.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/api-error-handler\n[github-tag]: http://img.shields.io/github/tag/expressjs/api-error-handler.svg?style=flat-square\n[github-url]: https://github.com/expressjs/api-error-handler/tags\n[travis-image]: https://img.shields.io/travis/expressjs/api-error-handler.svg?style=flat-square\n[travis-url]: https://travis-ci.org/expressjs/api-error-handler\n[coveralls-image]: https://img.shields.io/coveralls/expressjs/api-error-handler.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/expressjs/api-error-handler\n[david-image]: http://img.shields.io/david/expressjs/api-error-handler.svg?style=flat-square\n[david-url]: https://david-dm.org/expressjs/api-error-handler\n[license-image]: http://img.shields.io/npm/l/api-error-handler.svg?style=flat-square\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/api-error-handler.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/api-error-handler\n[gittip-image]: https://img.shields.io/gratipay/jonathanong.svg?style=flat-square\n[gittip-url]: https://gratipay.com/expressjs/\n","readmeFilename":"README.md","users":{"rocket0191":true}}