{ "_id": "vary", "_rev": "30-8d9c2f80a516b236fdad744c607b23e8", "name": "vary", "description": "Manipulate the HTTP Vary header", "dist-tags": { "latest": "1.1.2" }, "versions": { "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", "tarball": "https://registry.npmjs.org/vary/-/vary-0.0.0.tgz" }, "_from": ".", "_npmVersion": "1.4.3", "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" }, "maintainers": [ { "name": "dougwilson", "email": "doug@somethingdoug.com" } ], "directories": {} }, "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", "tarball": "https://registry.npmjs.org/vary/-/vary-0.1.0.tgz" }, "_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": {} }, "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", "tarball": "https://registry.npmjs.org/vary/-/vary-1.0.0.tgz" }, "directories": {} }, "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", "tarball": "https://registry.npmjs.org/vary/-/vary-1.0.1.tgz" }, "directories": {} }, "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", "tarball": "https://registry.npmjs.org/vary/-/vary-1.1.0.tgz" }, "directories": {} }, "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", "tarball": "https://registry.npmjs.org/vary/-/vary-1.1.1.tgz" }, "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": {} }, "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", "tarball": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz" }, "maintainers": [ { "name": "dougwilson", "email": "doug@somethingdoug.com" } ], "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/vary-1.1.2.tgz_1506217630296_0.28528453782200813" }, "directories": {} } }, "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\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\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\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", "maintainers": [ { "name": "dougwilson", "email": "doug@somethingdoug.com" } ], "time": { "modified": "2018-08-03T00:42:18.119Z", "created": "2014-06-04T20:52:53.541Z", "0.0.0": "2014-06-04T20:52:53.541Z", "0.1.0": "2014-06-05T13:18:33.789Z", "1.0.0": "2014-08-10T21:03:28.918Z", "1.0.1": "2015-07-09T00:03:07.257Z", "1.1.0": "2015-09-30T05:05:50.045Z", "1.1.1": "2017-03-20T21:32:29.340Z", "1.1.2": "2017-09-24T01:47:11.325Z" }, "homepage": "https://github.com/jshttp/vary#readme", "keywords": [ "http", "res", "vary" ], "repository": { "type": "git", "url": "git+https://github.com/jshttp/vary.git" }, "author": { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" }, "bugs": { "url": "https://github.com/jshttp/vary/issues" }, "license": "MIT", "readmeFilename": "README.md", "users": { "goodseller": true, "simplyianm": true, "jessaustin": true, "wangnan0610": true, "mojaray2k": true, "giussa_dan": true, "leland-kwong": true, "netoperatorwibby": true }, "_attachments": {} }