{ "_args": [ [ { "raw": "http-errors@1.6.2", "scope": null, "escapedName": "http-errors", "name": "http-errors", "rawSpec": "1.6.2", "spec": "1.6.2", "type": "version" }, "/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/raw-body" ] ], "_from": "http-errors@1.6.2", "_id": "http-errors@1.6.2", "_inCache": true, "_location": "/http-errors", "_nodeVersion": "6.11.1", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/http-errors-1.6.2.tgz_1501906124983_0.24086778541095555" }, "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" }, "_npmVersion": "3.10.10", "_phantomChildren": {}, "_requested": { "raw": "http-errors@1.6.2", "scope": null, "escapedName": "http-errors", "name": "http-errors", "rawSpec": "1.6.2", "spec": "1.6.2", "type": "version" }, "_requiredBy": [ "/body-parser", "/raw-body", "/send" ], "_resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", "_shasum": "0a002cc85707192a7e7946ceedc11155f60ec736", "_shrinkwrap": null, "_spec": "http-errors@1.6.2", "_where": "/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/raw-body", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", "url": "http://jongleberry.com" }, "bugs": { "url": "https://github.com/jshttp/http-errors/issues" }, "contributors": [ { "name": "Alan Plum", "email": "me@pluma.io" }, { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" } ], "dependencies": { "depd": "1.1.1", "inherits": "2.0.3", "setprototypeof": "1.0.3", "statuses": ">= 1.3.1 < 2" }, "description": "Create HTTP error objects", "devDependencies": { "eslint": "3.19.0", "eslint-config-standard": "10.2.1", "eslint-plugin-import": "2.7.0", "eslint-plugin-markdown": "1.0.0-beta.6", "eslint-plugin-node": "5.1.1", "eslint-plugin-promise": "3.5.0", "eslint-plugin-standard": "3.0.1", "istanbul": "0.4.5", "mocha": "1.21.5" }, "directories": {}, "dist": { "shasum": "0a002cc85707192a7e7946ceedc11155f60ec736", "tarball": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz" }, "engines": { "node": ">= 0.6" }, "files": [ "index.js", "HISTORY.md", "LICENSE", "README.md" ], "gitHead": "7e534cb45fc06e8c3ad782cde89a7462851b27d1", "homepage": "https://github.com/jshttp/http-errors#readme", "keywords": [ "http", "error" ], "license": "MIT", "maintainers": [ { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" }, { "name": "dougwilson", "email": "doug@somethingdoug.com" }, { "name": "egeste", "email": "npm@egeste.net" } ], "name": "http-errors", "optionalDependencies": {}, "readme": "# http-errors\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Node.js Version][node-version-image]][node-version-url]\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n\nCreate HTTP errors for Express, Koa, Connect, etc. with ease.\n\n## Install\n\nThis is a [Node.js](https://nodejs.org/en/) module available through the\n[npm registry](https://www.npmjs.com/). Installation is done using the\n[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):\n\n```bash\n$ npm install http-errors\n```\n\n## Example\n\n```js\nvar createError = require('http-errors')\nvar express = require('express')\nvar app = express()\n\napp.use(function (req, res, next) {\n if (!req.user) return next(createError(401, 'Please login to view this page.'))\n next()\n})\n```\n\n## API\n\nThis is the current API, currently extracted from Koa and subject to change.\n\nAll errors inherit from JavaScript `Error` and the exported `createError.HttpError`.\n\n### Error Properties\n\n- `expose` - can be used to signal if `message` should be sent to the client,\n defaulting to `false` when `status` >= 500\n- `headers` - can be an object of header names to values to be sent to the\n client, defaulting to `undefined`. When defined, the key names should all\n be lower-cased\n- `message` - the traditional error message, which should be kept short and all\n single line\n- `status` - the status code of the error, mirroring `statusCode` for general\n compatibility\n- `statusCode` - the status code of the error, defaulting to `500`\n\n### createError([status], [message], [properties])\n\n\n\n```js\nvar err = createError(404, 'This video does not exist!')\n```\n\n- `status: 500` - the status code as a number\n- `message` - the message of the error, defaulting to node's text for that status code.\n- `properties` - custom properties to attach to the object\n\n### new createError\\[code || name\\](\\[msg]\\))\n\n\n\n```js\nvar err = new createError.NotFound()\n```\n\n- `code` - the status code as a number\n- `name` - the name of the error as a \"bumpy case\", i.e. `NotFound` or `InternalServerError`.\n\n#### List of all constructors\n\n|Status Code|Constructor Name |\n|-----------|-----------------------------|\n|400 |BadRequest |\n|401 |Unauthorized |\n|402 |PaymentRequired |\n|403 |Forbidden |\n|404 |NotFound |\n|405 |MethodNotAllowed |\n|406 |NotAcceptable |\n|407 |ProxyAuthenticationRequired |\n|408 |RequestTimeout |\n|409 |Conflict |\n|410 |Gone |\n|411 |LengthRequired |\n|412 |PreconditionFailed |\n|413 |PayloadTooLarge |\n|414 |URITooLong |\n|415 |UnsupportedMediaType |\n|416 |RangeNotSatisfiable |\n|417 |ExpectationFailed |\n|418 |ImATeapot |\n|421 |MisdirectedRequest |\n|422 |UnprocessableEntity |\n|423 |Locked |\n|424 |FailedDependency |\n|425 |UnorderedCollection |\n|426 |UpgradeRequired |\n|428 |PreconditionRequired |\n|429 |TooManyRequests |\n|431 |RequestHeaderFieldsTooLarge |\n|451 |UnavailableForLegalReasons |\n|500 |InternalServerError |\n|501 |NotImplemented |\n|502 |BadGateway |\n|503 |ServiceUnavailable |\n|504 |GatewayTimeout |\n|505 |HTTPVersionNotSupported |\n|506 |VariantAlsoNegotiates |\n|507 |InsufficientStorage |\n|508 |LoopDetected |\n|509 |BandwidthLimitExceeded |\n|510 |NotExtended |\n|511 |NetworkAuthenticationRequired|\n\n## License\n\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/http-errors.svg\n[npm-url]: https://npmjs.org/package/http-errors\n[node-version-image]: https://img.shields.io/node/v/http-errors.svg\n[node-version-url]: https://nodejs.org/en/download/\n[travis-image]: https://img.shields.io/travis/jshttp/http-errors.svg\n[travis-url]: https://travis-ci.org/jshttp/http-errors\n[coveralls-image]: https://img.shields.io/coveralls/jshttp/http-errors.svg\n[coveralls-url]: https://coveralls.io/r/jshttp/http-errors\n[downloads-image]: https://img.shields.io/npm/dm/http-errors.svg\n[downloads-url]: https://npmjs.org/package/http-errors\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/jshttp/http-errors.git" }, "scripts": { "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec --bail", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" }, "version": "1.6.2" }