{
  "manifest": {
    "name": "on-headers",
    "description": "Execute a listener when a response is about to write headers",
    "version": "1.0.2",
    "author": {
      "name": "Douglas Christopher Wilson",
      "email": "doug@somethingdoug.com"
    },
    "license": "MIT",
    "keywords": [
      "event",
      "headers",
      "http",
      "onheaders"
    ],
    "repository": {
      "type": "git",
      "url": "https://github.com/jshttp/on-headers.git"
    },
    "devDependencies": {
      "eslint": "5.14.1",
      "eslint-config-standard": "12.0.0",
      "eslint-plugin-import": "2.16.0",
      "eslint-plugin-markdown": "1.0.0",
      "eslint-plugin-node": "8.0.1",
      "eslint-plugin-promise": "4.0.1",
      "eslint-plugin-standard": "4.0.0",
      "istanbul": "0.4.5",
      "mocha": "6.0.1",
      "supertest": "3.4.2"
    },
    "files": [
      "LICENSE",
      "HISTORY.md",
      "README.md",
      "index.js"
    ],
    "engines": {
      "node": ">= 0.8"
    },
    "scripts": {
      "lint": "eslint --plugin markdown --ext js,md .",
      "test": "mocha --reporter spec --bail --check-leaks test/",
      "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
      "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
      "version": "node scripts/version-history.js && git add HISTORY.md"
    },
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-on-headers-1.0.2-772b0ae6aaa525c399e489adfad90c403eb3c28f-integrity/node_modules/on-headers/package.json",
    "readmeFilename": "README.md",
    "readme": "# on-headers\n\n[![NPM Version][npm-version-image]][npm-url]\n[![NPM Downloads][npm-downloads-image]][npm-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\nExecute a listener when a response is about to write headers.\n\n## Installation\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```sh\n$ npm install on-headers\n```\n\n## API\n\n<!-- eslint-disable no-unused-vars -->\n\n```js\nvar onHeaders = require('on-headers')\n```\n\n### onHeaders(res, listener)\n\nThis will add the listener `listener` to fire when headers are emitted for `res`.\nThe listener is passed the `response` object as it's context (`this`). Headers are\nconsidered to be emitted only once, right before they are sent to the client.\n\nWhen this is called multiple times on the same `res`, the `listener`s are fired\nin the reverse order they were added.\n\n## Examples\n\n```js\nvar http = require('http')\nvar onHeaders = require('on-headers')\n\nhttp\n  .createServer(onRequest)\n  .listen(3000)\n\nfunction addPoweredBy () {\n  // set if not set by end of request\n  if (!this.getHeader('X-Powered-By')) {\n    this.setHeader('X-Powered-By', 'Node.js')\n  }\n}\n\nfunction onRequest (req, res) {\n  onHeaders(res, addPoweredBy)\n\n  res.setHeader('Content-Type', 'text/plain')\n  res.end('hello!')\n}\n```\n\n## Testing\n\n```sh\n$ npm test\n```\n\n## License\n\n[MIT](LICENSE)\n\n[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/on-headers/master\n[coveralls-url]: https://coveralls.io/r/jshttp/on-headers?branch=master\n[node-version-image]: https://badgen.net/npm/node/on-headers\n[node-version-url]: https://nodejs.org/en/download\n[npm-downloads-image]: https://badgen.net/npm/dm/on-headers\n[npm-url]: https://npmjs.org/package/on-headers\n[npm-version-image]: https://badgen.net/npm/v/on-headers\n[travis-image]: https://badgen.net/travis/jshttp/on-headers/master\n[travis-url]: https://travis-ci.org/jshttp/on-headers\n",
    "licenseText": "(The MIT License)\n\nCopyright (c) 2014 Douglas Christopher Wilson\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz",
    "hash": "772b0ae6aaa525c399e489adfad90c403eb3c28f",
    "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==",
    "registry": "npm",
    "packageName": "on-headers",
    "cacheIntegrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA== sha1-dysK5qqlJcOZ5Imt+tkMQD6zwo8="
  },
  "registry": "npm",
  "hash": "772b0ae6aaa525c399e489adfad90c403eb3c28f"
}