1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00
denoland-deno/tests/registry/npm/negotiator/registry.json

2 lines
7.4 KiB
JSON
Raw Normal View History

{"name":"negotiator","description":"HTTP content negotiation","dist-tags":{"latest":"0.6.3"},"versions":{"0.6.3":{"name":"negotiator","description":"HTTP content negotiation","version":"0.6.3","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jshttp/negotiator.git"},"devDependencies":{"eslint":"7.32.0","eslint-plugin-markdown":"2.2.1","mocha":"9.1.3","nyc":"15.1.0"},"engines":{"node":">= 0.6"},"scripts":{"lint":"eslint .","test":"mocha --reporter spec --check-leaks --bail test/","test-ci":"nyc --reporter=lcov --reporter=text npm test","test-cov":"nyc --reporter=html --reporter=text npm test"},"gitHead":"40a5acb0c878cca951bc44d1d9e2ab1f90ae813e","bugs":{"url":"https://github.com/jshttp/negotiator/issues"},"_id":"negotiator@0.6.3","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==","shasum":"58e323a72fedc0d6f9cd4d31fe49f51479590ccd","tarball":"http://localhost:4260/negotiator/negotiator-0.6.3.tgz","fileCount":9,"unpackedSize":27375,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7LRVCRA9TVsSAnZWagAADXQQAIRjFiv7jUhvg/7FE3tH\nLDOBadiC2gYFtN86BitJeUZGhyGMn0kkJQ4bxxRmZHfJBS3XGSDiPd3pRPWl\nyAB2HHJ3JpXS3pM1CdnUvxI6aLg/EVwO/qISHoFLYfx86M721ZPOoCs1mUDy\nVL0AZTR55cCIaF/5sl4CWKxWTnX2CUltGDJKKQsXo+eKuLhNZ8G76PdXABoG\n1gDpwALLFaAW0CYh/sIy6st9JTTx4gHkVcPHZLtsmeyzdKGMxzaXLpU6/xhr\nP2/lBMg6t8xRtu4e76/hzBJSaRnL78EXLndwYbdHXABoFkzM5qpLD+UY5eNT\nMsDK/aHTxnIIyg8LBC8qPagdH7sB8MXOnMzR7gKOjHzPUNqqQVpyCkc/ipaE\nsKNh0AfEJ6qxfht6DYT1sLGSCmDhX3ivleOiIj+nKSAeNa/rk1Hvsfj2FNQN\nKjFidMLwB04+l9chMTNEtNq/Pxk9+zen27vD0JkuqwXovgHvESRWGtlE47M8\npxi4gBypqHMUe9G6FO3RZ7pzLzkfXfwaKDWY28/TEskJO8rZsvsb87JL+BK1\nymaGSP/G7kQROLaTIY5/Oa5KbXI20DBvkkY77BofAOS/H/CTrFBe/vtoH3YM\nmuaNzt2miXUxKFQszMBL0uWjy9K49Yuf5+cHKPsuKydKDG/FeOaGLF6Eu9SI\nhK4i\r\n=du2Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwWK0qSZqF/rTSc9yQVnO06hqkMpn44qT6AjizctXUeQIhAJ6VHibmzze9aOy2LJSVenGWZcWx8zUFvmENe9uhlhZr"}]},"directories":{},"_hasShrinkwrap":false}},"readme":"# negotiator\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][github-actions-ci-image]][github-actions-ci-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n\nAn HTTP content negotiator for Node.js\n\n## Installation\n\n```sh\n$ npm install negotiator\n```\n\n## API\n\n```js\nvar Negotiator = require('negotiator')\n```\n\n### Accept Negotiation\n\n```js\navailableMediaTypes = ['text/html', 'text/plain', 'application/json']\n\n// The negotiator constructor receives a request object\nnegotiator = new Negotiator(request)\n\n// Let's say Accept header is 'text/html, application/*;q=0.2, image/jpeg;q=0.8'\n\nnegotiator.mediaTypes()\n// -> ['text/html', 'image/jpeg', 'application/*']\n\nnegotiator.mediaTypes(availableMediaTypes)\n// -> ['text/html', 'application/json']\n\nnegotiator.mediaType(availableMediaTypes)\n// -> 'text/html'\n```\n\nYou can check a working example at `examples/accept.js`.\n\n#### Methods\n\n##### mediaType()\n\nReturns the most preferred media type from the client.\n\n##### mediaType(availableMediaType)\n\nReturns the most preferred media type from a list of available media types.\n\n##### mediaTypes()\n\nReturns an array of preferred media types ordered by the client preference.\n\n##### mediaTypes(availableMediaTypes)\n\nReturns an array of preferred media types ordered by priority from a list of\navailable media types.\n\n### Accept-Language Negotiation\n\n```js\nnegotiator = new Negotiator(request)\n\navailableLanguages = ['en', 'es', 'fr']\n\n// Let's say Accept-Language header is 'en;q=0.8, es, pt'\n\nnegotiator.languages()\n// -> ['es', 'pt', 'en']\n\nnegotiator.languages(availableLanguages)\n// -> ['es', 'en']\n\nlanguage = negotiator.language(availableLanguages)\n// -> 'es'\n```\n\n