{"_attachments":{},"_id":"vary","_rev":"862-61f1455fb677e08f5113bfc1","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"description":"Manipulate the HTTP Vary header","dist-tags":{"latest":"1.1.2"},"license":"MIT","maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"},{"name":"blakeembrey","email":"hello@blakeembrey.com"},{"name":"ulisesgascon","email":"ulisesgascondev@gmail.com"}],"name":"vary","readme":"# vary\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\nManipulate the HTTP Vary header\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 vary\n```\n\n## API\n\n<!-- eslint-disable no-unused-vars -->\n\n```js\nvar vary = require('vary')\n```\n\n### vary(res, field)\n\nAdds the given header `field` to the `Vary` response header of `res`.\nThis can be a string of a single field, a string of a valid `Vary`\nheader, or an array of multiple fields.\n\nThis will append the header if not already listed, otherwise leaves\nit listed in the current location.\n\n<!-- eslint-disable no-undef -->\n\n```js\n// Append \"Origin\" to the Vary header of the response\nvary(res, 'Origin')\n```\n\n### vary.append(header, field)\n\nAdds the given header `field` to the `Vary` response header string `header`.\nThis can be a string of a single field, a string of a valid `Vary` header,\nor an array of multiple fields.\n\nThis will append the header if not already listed, otherwise leaves\nit listed in the current location. The new header string is returned.\n\n<!-- eslint-disable no-undef -->\n\n```js\n// Get header string appending \"Origin\" to \"Accept, User-Agent\"\nvary.append('Accept, User-Agent', 'Origin')\n```\n\n## Examples\n\n### Updating the Vary header when content is based on it\n\n```js\nvar http = require('http')\nvar vary = require('vary')\n\nhttp.createServer(function onRequest (req, res) {\n  // about to user-agent sniff\n  vary(res, 'User-Agent')\n\n  var ua = req.headers['user-agent'] || ''\n  var isMobile = /mobi|android|touch|mini/i.test(ua)\n\n  // serve site, depending on isMobile\n  res.setHeader('Content-Type', 'text/html')\n  res.end('You are (probably) ' + (isMobile ? '' : 'not ') + 'a mobile user')\n})\n```\n\n## Testing\n\n```sh\n$ npm test\n```\n\n## License\n\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/vary.svg\n[npm-url]: https://npmjs.org/package/vary\n[node-version-image]: https://img.shields.io/node/v/vary.svg\n[node-version-url]: https://nodejs.org/en/download\n[travis-image]: https://img.shields.io/travis/jshttp/vary/master.svg\n[travis-url]: https://travis-ci.org/jshttp/vary\n[coveralls-image]: https://img.shields.io/coveralls/jshttp/vary/master.svg\n[coveralls-url]: https://coveralls.io/r/jshttp/vary\n[downloads-image]: https://img.shields.io/npm/dm/vary.svg\n[downloads-url]: https://npmjs.org/package/vary\n","time":{"created":"2022-01-26T12:58:07.555Z","modified":"2025-05-14T14:56:40.618Z","1.1.2":"2017-09-24T01:47:11.325Z","1.1.1":"2017-03-20T21:32:29.340Z","1.1.0":"2015-09-30T05:05:50.045Z","1.0.1":"2015-07-09T00:03:07.257Z","1.0.0":"2014-08-10T21:03:28.918Z","0.1.0":"2014-06-05T13:18:33.789Z","0.0.0":"2014-06-04T20:52:53.541Z"},"versions":{"1.1.2":{"name":"vary","description":"Manipulate the HTTP Vary header","version":"1.1.2","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","keywords":["http","res","vary"],"repository":{"type":"git","url":"git+https://github.com/jshttp/vary.git"},"devDependencies":{"beautify-benchmark":"0.2.4","benchmark":"2.1.4","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":"2.5.3","supertest":"1.1.0"},"files":["HISTORY.md","LICENSE","README.md","index.js"],"engines":{"node":">= 0.8"},"scripts":{"bench":"node benchmark/index.js","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/"},"gitHead":"4067e646233fbc8ec9e7a9cd78d6f063c6fdc17e","bugs":{"url":"https://github.com/jshttp/vary/issues"},"homepage":"https://github.com/jshttp/vary#readme","_id":"vary@1.1.2","_shasum":"2299f02c6ded30d4a5961b0b9f74524a18f634fc","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.1","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"dist":{"shasum":"2299f02c6ded30d4a5961b0b9f74524a18f634fc","size":3772,"noattachment":false,"tarball":"https://registry.npmmirror.com/vary/-/vary-1.1.2.tgz","integrity":"sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="},"maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vary-1.1.2.tgz_1506217630296_0.28528453782200813"},"directories":{},"publish_time":1506217631325,"_hasShrinkwrap":false,"_cnpm_publish_time":1506217631325,"_cnpmcore_publish_time":"2021-12-13T10:20:58.399Z"},"1.1.1":{"name":"vary","description":"Manipulate the HTTP Vary header","version":"1.1.1","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","keywords":["http","res","vary"],"repository":{"type":"git","url":"git+https://github.com/jshttp/vary.git"},"devDependencies":{"eslint":"3.18.0","eslint-config-standard":"7.1.0","eslint-plugin-markdown":"1.0.0-beta.4","eslint-plugin-promise":"3.5.0","eslint-plugin-standard":"2.1.1","istanbul":"0.4.5","mocha":"2.5.3","supertest":"1.1.0"},"files":["HISTORY.md","LICENSE","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/"},"gitHead":"ca7edac6b919a45bf9e2c5cb6ba31c1790e9f046","bugs":{"url":"https://github.com/jshttp/vary/issues"},"homepage":"https://github.com/jshttp/vary#readme","_id":"vary@1.1.1","_shasum":"67535ebb694c1d52257457984665323f587e8d37","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.3","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"dist":{"shasum":"67535ebb694c1d52257457984665323f587e8d37","size":3582,"noattachment":false,"tarball":"https://registry.npmmirror.com/vary/-/vary-1.1.1.tgz","integrity":"sha512-kCupYIvF6ltl975bvRTPK/Ml8aAZ32u1JgZ4QpuL20w3lWEJYlD90NQmXIcnAliEDN62MA4V96A2uq5cBsHSJA=="},"maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/vary-1.1.1.tgz_1490045547529_0.9355870047584176"},"directories":{},"publish_time":1490045549340,"_hasShrinkwrap":false,"_cnpm_publish_time":1490045549340,"_cnpmcore_publish_time":"2021-12-13T10:20:58.720Z"},"1.1.0":{"name":"vary","description":"Manipulate the HTTP Vary header","version":"1.1.0","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","keywords":["http","res","vary"],"repository":{"type":"git","url":"https://github.com/jshttp/vary"},"devDependencies":{"istanbul":"0.3.21","mocha":"2.3.3","supertest":"1.1.0"},"files":["HISTORY.md","LICENSE","README.md","index.js"],"engines":{"node":">= 0.8"},"scripts":{"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/"},"gitHead":"13b03e9bf97da9d83bfeac84d84144137d84c257","bugs":{"url":"https://github.com/jshttp/vary/issues"},"homepage":"https://github.com/jshttp/vary","_id":"vary@1.1.0","_shasum":"e1e5affbbd16ae768dd2674394b9ad3022653140","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"fishrock123","email":"fishrock123@rocketmail.com"}],"dist":{"shasum":"e1e5affbbd16ae768dd2674394b9ad3022653140","size":3272,"noattachment":false,"tarball":"https://registry.npmmirror.com/vary/-/vary-1.1.0.tgz","integrity":"sha512-uM/iZxl0TaIXDYreb7fo4zACmS3hk2ywle8HR44gJ6HlqZ0fb4gjEJnMBMAmH0T1HxdGU8RlUvY9ekkoLsV+1A=="},"directories":{},"publish_time":1443589550045,"_hasShrinkwrap":false,"_cnpm_publish_time":1443589550045,"_cnpmcore_publish_time":"2021-12-13T10:20:58.987Z"},"1.0.1":{"name":"vary","description":"Manipulate the HTTP Vary header","version":"1.0.1","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","keywords":["http","res","vary"],"repository":{"type":"git","url":"https://github.com/jshttp/vary"},"devDependencies":{"istanbul":"0.3.17","mocha":"2.2.5","supertest":"1.0.1"},"files":["HISTORY.md","LICENSE","README.md","index.js"],"engines":{"node":">= 0.8"},"scripts":{"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/"},"gitHead":"650282ff8e614731837040a23e10f51c20728392","bugs":{"url":"https://github.com/jshttp/vary/issues"},"homepage":"https://github.com/jshttp/vary","_id":"vary@1.0.1","_shasum":"99e4981566a286118dfb2b817357df7993376d10","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"fishrock123","email":"fishrock123@rocketmail.com"}],"dist":{"shasum":"99e4981566a286118dfb2b817357df7993376d10","size":3073,"noattachment":false,"tarball":"https://registry.npmmirror.com/vary/-/vary-1.0.1.tgz","integrity":"sha512-yNsH+tC0r8quK2tg/yqkXqqaYzeKTkSqQ+8T6xCoWgOi/bU/omMYz+6k+I91JJJDeltJzI7oridTOq6OYkY0Tw=="},"directories":{},"publish_time":1436400187257,"_hasShrinkwrap":false,"_cnpm_publish_time":1436400187257,"_cnpmcore_publish_time":"2021-12-13T10:20:59.338Z"},"1.0.0":{"name":"vary","description":"Manipulate the HTTP Vary header","version":"1.0.0","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","keywords":["http","res","vary"],"repository":{"type":"git","url":"https://github.com/jshttp/vary"},"devDependencies":{"istanbul":"0.3.0","mocha":"~1.21.4","should":"~4.0.4","supertest":"~0.13.0"},"engines":{"node":">= 0.8.0"},"scripts":{"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/"},"gitHead":"56acecd9fa20888132563b00576625ea02a69a35","bugs":{"url":"https://github.com/jshttp/vary/issues"},"homepage":"https://github.com/jshttp/vary","_id":"vary@1.0.0","_shasum":"c5e76cec20d3820d8f2a96e7bee38731c34da1e7","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"fishrock123","email":"fishrock123@rocketmail.com"},{"name":"shtylman","email":"shtylman@gmail.com"}],"dist":{"shasum":"c5e76cec20d3820d8f2a96e7bee38731c34da1e7","size":2722,"noattachment":false,"tarball":"https://registry.npmmirror.com/vary/-/vary-1.0.0.tgz","integrity":"sha512-jyU3YP3IiUHjpoy3ZC83R+cxWPJWV2c6cKvNl6xvdMNvdjP507SuRm74niIaHfvsqAk5J9j9xa9ejWSxsHNIrg=="},"directories":{},"publish_time":1407704608918,"_hasShrinkwrap":false,"_cnpm_publish_time":1407704608918,"_cnpmcore_publish_time":"2021-12-13T10:20:59.663Z"},"0.1.0":{"name":"vary","description":"Update the Vary header of a response","version":"0.1.0","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","keywords":["http","res","vary"],"repository":{"type":"git","url":"git://github.com/expressjs/vary"},"devDependencies":{"istanbul":"0.2.10","mocha":"~1.20.0","should":"~4.0.0"},"engines":{"node":">= 0.8.0"},"scripts":{"test":"mocha --reporter dot test/","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec test/"},"bugs":{"url":"https://github.com/expressjs/vary/issues"},"homepage":"https://github.com/expressjs/vary","_id":"vary@0.1.0","dist":{"shasum":"df0945899e93c0cc5bd18cc8321d9d21e74f6176","size":2305,"noattachment":false,"tarball":"https://registry.npmmirror.com/vary/-/vary-0.1.0.tgz","integrity":"sha512-tyyeG46NQdwyVP/RsWLSrT78ouwEuvwk9gK8vQK4jdXmqoXtTXW+vsCfNcnqRhigF8olV34QVZarmAi6wBV2Mw=="},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"fishrock123","email":"fishrock123@rocketmail.com"},{"name":"shtylman","email":"shtylman@gmail.com"},{"name":"tjholowaychuk","email":"tj@vision-media.ca"}],"directories":{},"publish_time":1401974313789,"_hasShrinkwrap":false,"_cnpm_publish_time":1401974313789,"_cnpmcore_publish_time":"2021-12-13T10:20:59.979Z"},"0.0.0":{"name":"vary","description":"Update the Vary header of a response","version":"0.0.0","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","keywords":["http","res","vary"],"repository":{"type":"git","url":"git://github.com/expressjs/vary"},"devDependencies":{"istanbul":"0.2.10","mocha":"~1.20.0","should":"~4.0.0"},"engines":{"node":">= 0.8.0"},"scripts":{"test":"mocha --reporter dot test/","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec test/"},"bugs":{"url":"https://github.com/expressjs/vary/issues"},"homepage":"https://github.com/expressjs/vary","_id":"vary@0.0.0","dist":{"shasum":"9edfb6837236e6fa500788995cd85a11c62c482d","size":2119,"noattachment":false,"tarball":"https://registry.npmmirror.com/vary/-/vary-0.0.0.tgz","integrity":"sha512-UMiXFkp/fpgXUzzku5kywQDrCAIj1l5afYOXcW0E/7q9kf3US3ajtXnLj0gPMXNZ0fXsV1c1MTPn6MP++FnuFg=="},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"}],"directories":{},"publish_time":1401915173541,"_hasShrinkwrap":false,"_cnpm_publish_time":1401915173541,"_cnpmcore_publish_time":"2021-12-13T10:21:00.370Z"}},"bugs":{"url":"https://github.com/jshttp/vary/issues"},"homepage":"https://github.com/jshttp/vary#readme","keywords":["http","res","vary"],"repository":{"type":"git","url":"git+https://github.com/jshttp/vary.git"},"_source_registry_name":"default"}