{"_id":"@fastify/accept-negotiator","_rev":"16-a8c011b0ccc272ea556594a10fe82402","name":"@fastify/accept-negotiator","dist-tags":{"next":"2.0.0","latest":"2.0.1"},"versions":{"1.0.0":{"name":"@fastify/accept-negotiator","version":"1.0.0","keywords":["encoding","negotiator","accept-encoding","accept","http","header"],"author":{"name":"Aras Abbasi"},"license":"MIT","_id":"@fastify/accept-negotiator@1.0.0","maintainers":[{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"coopflow","email":"community@coopflow.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"rafaelgss","email":"rafael.nunu@hotmail.com"},{"name":"starptech","email":"deusdustin@gmail.com"},{"name":"delvedor","email":"tommydelved@gmail.com"},{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"allevo","email":"tomallevi@gmail.com"},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"zekth","email":"vince.legoff@gmail.com"},{"name":"ethan_arrowood","email":"ethan@arrowood.dev"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fox1t","email":"maksim@sinik.it"},{"name":"davidmarkclements","email":"david.mark.clements@gmail.com"},{"name":"airhorns","email":"harry@harry.me"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"}],"homepage":"https://github.com/@fastify/encoding-negotiator#readme","bugs":{"url":"https://github.com/fastify/encoding-negotiator/issues"},"dist":{"shasum":"f0e73a3f8c6ba739d66a629b386c838889ec7a23","tarball":"https://registry.npmjs.org/@fastify/accept-negotiator/-/accept-negotiator-1.0.0.tgz","fileCount":5,"integrity":"sha512-4R/N2KfYeld7A5LGkai+iUFMahXcxxYbDp+XS2B1yuL3cdmZLJ9TlCnNzT3q5xFTqsYm0GPpinLUwfSwjcVjyA==","signatures":[{"sig":"MEUCIFpTqjXQW08PbfBkWtKN7k21tPPrDajIsvm7EtkMGDH8AiEAn7vPwydgoxYjH/p2sfRXOgmH/KUom4E4wc5jkDsdSHQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuNPFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp7PxAAhHMOAlQD+bf4doh5vkMyCuuy1lCotDzybE31LGtrGDa7MIsQ\r\ny+PcMnr93ml5hufiwvsLjQXwyJZ/9Z4Laq7GW2GEtYcpJHXv+0COuEcsBxQD\r\nvLhzl7uKQr9sSzoy7JW6vNouceBfpUeDLfth/mFDQjOrZSdFGOmSEB9iBbeQ\r\ni+Kww/BtYQ5w+dxbyymU1QRKnsRizWHYHnEHa3qHQ8q2AeX/zFBTowZxyyCh\r\nns+aHRFLF1zUmZ2E3yXfWPYwfvbNKwPY6zSCn3Ix4ZhWHmUsuh20tq9q1tmW\r\nlPmOpXfNtE4W7CWh/Fkw56lWJGsMVHkmGEdOopwCzjz5sDTDJHgTwcPbNzEC\r\nAc5G0ThFZUyIwScc49Ruww2y8vldIqPaNJXAflY74IMJpZqosMbr3Q1j6IxT\r\nyhfIRIUerY3lQZ6qkqMKgCZqdfs8OPclwgJdc0qUbOwzZHqkLgu0e0++5pP4\r\nM7Frm/Cu3btU1VEBPa6sivbijSAPJ3+ADR8BwSr2J9moanLwJWcLSdFCAmcC\r\nNNNaTA26WUGrx8F3pEPw/KAF6HkRyFXuw+7aJ7ziOrnjym3Cxlg7Fkcj/7UE\r\nFMPAUWx2dcX+EuLnz4cxwU9tMbsCZRgt0faT0pP8SkLpArG1oj27s7Uu2AIe\r\nfz/b7CKFngY2JA9HVoCpbp6eLYH9Ywwh408=\r\n=U3QH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","type":"commonjs","types":"types/index.d.ts","engines":{"node":">=14"},"gitHead":"276a8db1fc945b3c5f04ceec333a6bf997f9a8e9","scripts":{"lint":"standard index.js test/* benchmarks/*","test":"tsd && nyc node ./test/index.js"},"_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"standard":{"ignore":["index.d.ts"]},"repository":{"url":"git+https://github.com/@fastify/encoding-negotiator.git","type":"git"},"_npmVersion":"8.11.0","description":"a negotiator for the accept-headers","directories":{},"_nodeVersion":"16.15.1","_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","tsd":"^0.21.0","standard":"17.0.0","benchmark":"2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/accept-negotiator_1.0.0_1656280005366_0.9247708481581653","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@fastify/accept-negotiator","version":"1.1.0","keywords":["encoding","negotiator","accept-encoding","accept","http","header"],"author":{"name":"Aras Abbasi"},"license":"MIT","_id":"@fastify/accept-negotiator@1.1.0","maintainers":[{"name":"galvez","email":"jonasgalvez@gmail.com"},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"coopflow","email":"community@coopflow.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"rafaelgss","email":"rafael.nunu@hotmail.com"},{"name":"starptech","email":"deusdustin@gmail.com"},{"name":"delvedor","email":"tommydelved@gmail.com"},{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"allevo","email":"tomallevi@gmail.com"},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"zekth","email":"vince.legoff@gmail.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fox1t","email":"maksim@sinik.it"},{"name":"davidmarkclements","email":"david.mark.clements@gmail.com"},{"name":"airhorns","email":"harry@harry.me"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"}],"homepage":"https://github.com/fastify/accept-negotiator#readme","bugs":{"url":"https://github.com/fastify/accept-negotiator/issues"},"dist":{"shasum":"c1c66b3b771c09742a54dd5bc87c582f6b0630ff","tarball":"https://registry.npmjs.org/@fastify/accept-negotiator/-/accept-negotiator-1.1.0.tgz","fileCount":5,"integrity":"sha512-OIHZrb2ImZ7XG85HXOONLcJWGosv7sIvM2ifAPQVhg9Lv7qdmMBNVaai4QTdyuaqbKM5eO6sLSQOYI7wEQeCJQ==","signatures":[{"sig":"MEUCIQC00LkT63CSUN0icImjSDYIEkgsniAdnYnpyzsvcEBdCAIgDWFXwTOl1NVQkmGcABFBN4sNOgTcagebpIKDVfjc8Zs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8197,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjNLKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo8jRAAlr4AQ2LXhdzb0jTZRX7tRBFR/7JyH1g6ENyQ2qIHDWTu87Tt\r\nTWWaeQ5gQQI4tNrbfvifCGDzgM0RooJGdGDtl9S2Z+23WIWP6lwE/3982FKe\r\npxlgvF3aqBu/KstGGgN7TiFsR42MFqBkxNyEr8Xb4qbxnsPPFkzuh0AZ3AxK\r\nP2Ekp+y53GY4RIomv+/a84YUuZMNYx0CA5cGZ4SPS8NY1XupJ3F6LEiCEago\r\nNqMR3sYfuNkt0yeLxeQRLDHcWt2l+gfjsAi6HCfavyDiAssLKU/FIoDkmR/w\r\nLfQITmiI/d0NwIAnISozggOigHTyWWAzUmLQPtDAZxr68knaRXAGLT/MVJrb\r\nR1QvOwbRcYS6C5jE4lAnAjh5dxHGQUlxI61Z6DlrEISaXnF94htxGxjuDdLw\r\nnPnXvRy14N0uB08czzynGEokiFWB6RnMMuB8V6OcI/VPPgrd+zL9SKAqJLlu\r\nwLM4fMdul664KtNzU6XotaFmnScIxNU51skl5QSdVDSCL6msUtoo5hDQxe1u\r\nm6fJjGPU7DlmV8YoJR65tKgDL0Sc/X73mVCkFhnSJ34J1grhkcUi/mATQmhN\r\nnM4JxwphNLiTkMuNKZE8TK/5XbkGCF1INRgX8ykdz8m9UE6HtjWHCkyAjye0\r\n/oT6ExWKPY92XNjyp5AstnNbstbKiJn3AsE=\r\n=JoQT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","type":"commonjs","types":"types/index.d.ts","engines":{"node":">=14"},"gitHead":"054b9cf7f06abf0b9c9c098b8b731758d823d167","scripts":{"lint":"standard index.js test/* benchmarks/*","test":"npm run test:unit && npm run test:typescript","test:unit":"tap","test:typescript":"tsd"},"_npmUser":{"name":"eomm","email":"behemoth89@gmail.com"},"standard":{"ignore":["index.d.ts"]},"repository":{"url":"git+https://github.com/fastify/accept-negotiator.git","type":"git"},"_npmVersion":"8.10.0","description":"a negotiator for the accept-headers","directories":{},"_nodeVersion":"16.13.0","_hasShrinkwrap":false,"devDependencies":{"tap":"^16.3.0","tsd":"^0.24.1","standard":"17.0.0","benchmark":"2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/accept-negotiator_1.1.0_1670173386594_0.48004494268184605","host":"s3://npm-registry-packages"}},"2.0.0-pre.fv5.1":{"name":"@fastify/accept-negotiator","version":"2.0.0-pre.fv5.1","keywords":["encoding","negotiator","accept-encoding","accept","http","header"],"author":{"name":"Aras Abbasi"},"license":"MIT","_id":"@fastify/accept-negotiator@2.0.0-pre.fv5.1","maintainers":[{"name":"gurgunday","email":"hey@gurgun.day"},{"name":"metcoder95","email":"me@metcoder.dev"},{"name":"galvez","email":"jonasgalvez@gmail.com"},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"coopflow","email":"community@coopflow.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"rafaelgss","email":"rafael.nunu@hotmail.com"},{"name":"starptech","email":"deusdustin@gmail.com"},{"name":"delvedor","email":"tommydelved@gmail.com"},{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"allevo","email":"tomallevi@gmail.com"},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"zekth","email":"vince.legoff@gmail.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fox1t","email":"maksim@sinik.it"},{"name":"airhorns","email":"harry@harry.me"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"}],"homepage":"https://github.com/fastify/accept-negotiator#readme","bugs":{"url":"https://github.com/fastify/accept-negotiator/issues"},"dist":{"shasum":"56bdcbdd22f214ae68e2ce8b9300a6d438fb1090","tarball":"https://registry.npmjs.org/@fastify/accept-negotiator/-/accept-negotiator-2.0.0-pre.fv5.1.tgz","fileCount":5,"integrity":"sha512-HVj9ELGUv71QuOFiYWxBUrKL+HhN+MwiZtl7kEOrV5hJc/rh/cjP5eQp9udtwPaV1iutNSLg40dJLtzQKFVxLA==","signatures":[{"sig":"MEQCIAT5kYfsZKnTUOhfD0MptDSLDtZE8mVRcHW4pJq6/1kzAiBUwGM7iq0HyQ0oUo9eF9NOLL0Fcw971RcZrTBJ0owciQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8205},"main":"index.js","type":"commonjs","types":"types/index.d.ts","gitHead":"3347ba4440b5b25324193b9409085d088cdc4855","scripts":{"lint":"standard index.js test/* benchmarks/*","test":"npm run test:unit && npm run test:typescript","test:unit":"tap","test:typescript":"tsd"},"_npmUser":{"name":"jsumners","email":"james.sumners@gmail.com"},"standard":{"ignore":["index.d.ts"]},"repository":{"url":"git+https://github.com/fastify/accept-negotiator.git","type":"git"},"_npmVersion":"10.7.0","description":"a negotiator for the accept-headers","directories":{},"_nodeVersion":"20.15.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tap":"^18.7.2","tsd":"^0.31.0","standard":"17.1.0","benchmark":"2.1.4","@fastify/pre-commit":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/accept-negotiator_2.0.0-pre.fv5.1_1720175586121_0.1816654635635342","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@fastify/accept-negotiator","version":"2.0.0","keywords":["encoding","negotiator","accept-encoding","accept","http","header"],"author":{"name":"Aras Abbasi"},"license":"MIT","_id":"@fastify/accept-negotiator@2.0.0","maintainers":[{"name":"gurgunday","email":"hey@gurgun.day"},{"name":"metcoder95","email":"me@metcoder.dev"},{"name":"galvez","email":"jonasgalvez@gmail.com"},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"coopflow","email":"community@coopflow.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"rafaelgss","email":"rafael.nunu@hotmail.com"},{"name":"starptech","email":"deusdustin@gmail.com"},{"name":"delvedor","email":"tommydelved@gmail.com"},{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"allevo","email":"tomallevi@gmail.com"},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"zekth","email":"vince.legoff@gmail.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fox1t","email":"maksim@sinik.it"},{"name":"airhorns","email":"harry@harry.me"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"}],"homepage":"https://github.com/fastify/accept-negotiator#readme","bugs":{"url":"https://github.com/fastify/accept-negotiator/issues"},"dist":{"shasum":"efce76b4d658e7ee669e681c2d79bffc9a654fdb","tarball":"https://registry.npmjs.org/@fastify/accept-negotiator/-/accept-negotiator-2.0.0.tgz","fileCount":5,"integrity":"sha512-/Sce/kBzuTxIq5tJh85nVNOq9wKD8s+viIgX0fFMDBdw95gnpf53qmF1oBgJym3cPFliWUuSloVg/1w/rH0FcQ==","signatures":[{"sig":"MEQCIEYrS+794KNiT3LZVEoSTQTSxLNRWETGDUYrtXGKek3YAiBciaQjjrRWkA5blcF6YHg1AeHK6nNYU5esvvMQ+5Vtfw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8195},"main":"index.js","type":"commonjs","types":"types/index.d.ts","gitHead":"3ecf1d0ebe7b309b6d8952620c7526b254b8a09e","scripts":{"lint":"standard index.js test/* benchmarks/*","test":"npm run test:unit && npm run test:typescript","test:unit":"tap","test:typescript":"tsd"},"_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"standard":{"ignore":["index.d.ts"]},"repository":{"url":"git+https://github.com/fastify/accept-negotiator.git","type":"git"},"_npmVersion":"10.8.1","description":"a negotiator for the accept-headers","directories":{},"_nodeVersion":"20.16.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tap":"^18.7.2","tsd":"^0.31.0","standard":"17.1.0","benchmark":"2.1.4","@fastify/pre-commit":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/accept-negotiator_2.0.0_1725369759138_0.9321817920431748","host":"s3://npm-registry-packages"}},"2.0.1":{"name":"@fastify/accept-negotiator","version":"2.0.1","keywords":["encoding","negotiator","accept-encoding","accept","http","header"],"author":{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},"license":"MIT","_id":"@fastify/accept-negotiator@2.0.1","maintainers":[{"name":"starptech","email":"deusdustin@gmail.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"coopflow","email":"community@coopflow.com"},{"name":"delvedor","email":"tommydelved@gmail.com"},{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"allevo","email":"tomallevi@gmail.com"},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"zekth","email":"vince.legoff@gmail.com"},{"name":"rafaelgss","email":"rafael.nunu@hotmail.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fox1t","email":"maksim@sinik.it"},{"name":"airhorns","email":"harry@harry.me"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"galvez","email":"jonasgalvez@gmail.com"},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"gurgunday","email":"hey@gurgun.day"},{"name":"metcoder95","email":"me@metcoder.dev"}],"contributors":[{"name":"Matteo Collina","email":"hello@matteocollina.com"},{"name":"Manuel Spigolon","email":"behemoth89@gmail.com"},{"url":"https://james.sumners.info","name":"James Sumners"},{"url":"https://github.com/fdawgs","name":"Frazer Smith","email":"frazer.dev@icloud.com"}],"homepage":"https://github.com/fastify/accept-negotiator#readme","bugs":{"url":"https://github.com/fastify/accept-negotiator/issues"},"dist":{"shasum":"77afd6254ba77f6c22c6f35c4fb0c1b6d005199b","tarball":"https://registry.npmjs.org/@fastify/accept-negotiator/-/accept-negotiator-2.0.1.tgz","fileCount":5,"integrity":"sha512-/c/TW2bO/v9JeEgoD/g1G5GxGeCF1Hafdf79WPmUlgYiBXummY0oX3VVq4yFkKKVBKDNlaDUYoab7g38RpPqCQ==","signatures":[{"sig":"MEQCIBdFwe/r1owy84oaKm2Du3kHPqmYDrR6bkfi9PrNnPrFAiBGWlS3zENhVnqpY6Rcdhd4U9P0QJqxbg+F3hUn2QbtnA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9029},"main":"index.js","type":"commonjs","types":"types/index.d.ts","funding":[{"url":"https://github.com/sponsors/fastify","type":"github"},{"url":"https://opencollective.com/fastify","type":"opencollective"}],"gitHead":"06b949d26896b6b0527beb4457c03519f1d0a293","scripts":{"lint":"eslint","test":"npm run test:unit && npm run test:typescript","lint:fix":"eslint --fix","test:unit":"c8 --100 node --test","test:typescript":"tsd"},"_npmUser":{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},"repository":{"url":"git+https://github.com/fastify/accept-negotiator.git","type":"git"},"_npmVersion":"10.2.4","description":"a negotiator for the accept-headers","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.2","tsd":"^0.31.0","eslint":"^9.17.0","benchmark":"2.1.4","neostandard":"^0.12.0","@fastify/pre-commit":"^2.1.0","@matteo.collina/tspl":"^0.1.1"},"_npmOperationalInternal":{"tmp":"tmp/accept-negotiator_2.0.1_1735813700412_0.7095768916032021","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2022-06-26T21:46:45.308Z","modified":"2026-03-05T20:01:49.690Z","1.0.0":"2022-06-26T21:46:45.492Z","1.1.0":"2022-12-04T17:03:06.763Z","2.0.0-pre.fv5.1":"2024-07-05T10:33:06.288Z","2.0.0":"2024-09-03T13:22:39.329Z","2.0.1":"2025-01-02T10:28:20.620Z"},"bugs":{"url":"https://github.com/fastify/accept-negotiator/issues"},"author":{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},"license":"MIT","homepage":"https://github.com/fastify/accept-negotiator#readme","keywords":["encoding","negotiator","accept-encoding","accept","http","header"],"repository":{"url":"git+https://github.com/fastify/accept-negotiator.git","type":"git"},"description":"a negotiator for the accept-headers","contributors":[{"name":"Matteo Collina","email":"hello@matteocollina.com"},{"name":"Manuel Spigolon","email":"behemoth89@gmail.com"},{"url":"https://james.sumners.info","name":"James Sumners"},{"url":"https://github.com/fdawgs","name":"Frazer Smith","email":"frazer.dev@icloud.com"}],"maintainers":[{"email":"simone.busoli@gmail.com","name":"simoneb"},{"email":"tommydelved@gmail.com","name":"delvedor"},{"email":"hello@matteocollina.com","name":"matteo.collina"},{"email":"james.sumners@gmail.com","name":"jsumners"},{"email":"vince.legoff@gmail.com","name":"zekth"},{"email":"behemoth89@gmail.com","name":"eomm"},{"email":"maksim@sinik.it","name":"fox1t"},{"email":"harry@harry.me","name":"airhorns"},{"email":"iselwin@gmail.com","name":"kibertoad"},{"email":"kaka@kakawebsitedemo.com","name":"climba03003"},{"email":"jonasgalvez@gmail.com","name":"galvez"},{"email":"sbekkhus91@gmail.com","name":"simenb"},{"email":"hey@gurgun.day","name":"gurgunday"},{"email":"a.tripodi133@gmail.com","name":"tony133"},{"email":"me@metcoder.dev","name":"metcoder95"},{"email":"jean.antoine.michelet@gmail.com","name":"jean-michelet"}],"readme":"# @fastify/accept-negotiator\n\n\n[![CI](https://github.com/fastify/accept-negotiator/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/fastify/accept-negotiator/actions/workflows/ci.yml)\n[![NPM version](https://img.shields.io/npm/v/@fastify/accept-negotiator.svg?style=flat)](https://www.npmjs.com/package/@fastify/accept-negotiator)\n[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)\n\nA negotiator for accept-* headers.\n\n### Install\n```\nnpm i @fastify/accept-negotiator\n```\n\n### Usage\n\nThe module exports a function that you can use for negotiating an accept-* header such as [`accept-encoding`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding). It takes 2 parameters:\n\n```\nnegotiate(header, supportedValues)\n```\n\n- `header` (`string`, required) - The accept-header, e.g. accept-encoding\n- `supportedValues` (`string[]`, required) - The values, which are supported\n\n```js\nconst negotiate = require('@fastify/accept-negotiator').negotiate\nconst encoding = negotiate('gzip, deflate, br', ['br'])\nconsole.log(encoding) // 'br*\n```\n\nThe module also exports a class that you can use for negotiating an accept-* header, and use caching for better performance.\n\n\n```\nNegotiate(supportedValues)\n```\n\n- `supportedValues` (`string[]`, required) - The values, which are supported\n- `cache` (`{ set: Function; get: Function; has: Function }`, optional) - A Cache-Store, e.g. ES6-Map or mnemonist LRUCache\n\n```js\nconst Negotiator = require('@fastify/accept-negotiator').Negotiator\nconst encodingNegotiator = new Negotiator({ supportedValues: ['br'], cache: new Map() })\n\nconst encoding = encodingNegotiator.negotiate('gzip, deflate, br')\nconsole.log(encoding) // 'br*\n```\n\n## License\n\nLicensed under [MIT](./LICENSE).\n","readmeFilename":"README.md"}