negotiator
npmv1.1.0HTTP content negotiation
Safe to adopt
Yes — negotiator scores well across adoption, maintenance, weight, supply chain, and licensing. 203.7M downloads per week and 2 known dependents. Last published 20 days ago. 2 releases in the last 2 years.
- AAdoption: grade A, Excellent.
203.7M downloads per week and 2 known dependents.
- AMaintenance: grade A, Excellent.
Last published 20 days ago. 2 releases in the last 2 years.
- AWeight: grade A, Excellent.
Pulls in 1 transitive package, about 46 KB installed.
- ASupply chain: grade A, Excellent.
No install scripts, 5 maintainers, and a contained dependency surface.
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding negotiator to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Licenses in the dependency tree
Every license you inherit by installing negotiator, not just its own. Check this before a legal review, not after.
Compatibility
- Node.js
- node >=18
- Module format
- CommonJS only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the negotiator README.
var Negotiator = require('negotiator')negotiator vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| negotiatorthis page | 203.7M | 2 | MIT | 20 days ago |
| content-type | 206.7M | 6 | MIT | 6 days ago |
| node-fetch | 194.2M | 9 | MIT | 6 days ago |
| undici | 172.9M | 15 | MIT | 6 days ago |
| http-errors | 169.9M | 7 | MIT | 6 days ago |
| accepts | 148.3M | 7 | MIT | 7 days ago |
Dependencies
Declared by negotiator v1.1.0. Runtime dependencies are installed with the package; dev dependencies are not.
Runtime (1)
Dev (5)
Used by
Popular packages that depend on negotiator.
Relationship graph
Dependencies (left) and dependents (right) of negotiator.
Frequently installed together
The ultimate javascript content-type utility.
An AST-based pattern checker for JavaScript.
just emit 'log' events on the process object
Retries a function that returns a promise, leveraging the power of the retry module.
the http/https agent used by the npm cli
Redact sensitive npm information from output
create a pipeline of streams using Minipass
Parses Cache-Control and other headers. Helps building correct HTTP caches and proxies
An implementation of window.fetch in Node.js using Minipass streams
Standard Subresource Integrity library -- parses, serializes, generates, and verifies integrity metadata according to the SRI spec.
node's assert.deepEqual algorithm
Safer Node.js Buffer API
Release history
1 release in the last two years, typically about 58 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 1.1.0latest | 20 days ago | 24 KB | MIT |
| 0.6.4 | 1 year ago | 28 KB | MIT |
| 1.0.0 | 2 years ago | 28 KB | MIT |
| 0.6.3 | 4 years ago | 27 KB | MIT |
| 0.6.2 | 7 years ago | 27 KB | MIT |
| 0.6.1 | 10 years ago | — | MIT |
| 0.6.0 | 11 years ago | — | MIT |
| 0.5.3 | 11 years ago | — | MIT |
| 0.5.2 | 11 years ago | — | MIT |
| 0.5.1 | 11 years ago | — | MIT |
| 0.5.0 | 11 years ago | — | MIT |
| 0.4.9 | 12 years ago | — | MIT |
| 0.4.8 | 12 years ago | — | MIT |
| 0.4.7 | 12 years ago | — | MIT |
| 0.4.6 | 12 years ago | — | MIT |
Overview
negotiator is an npm package that hTTP content negotiation. It is extremely widely used, with about 203.7M downloads per week and 2 known dependents in the graph. The latest version is 1.1.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need hTTP content negotiation and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (203.7M weekly downloads).
- Clear open-source license (MIT).
Cons
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Funding
Frequently asked questions
Should I use negotiator?
Yes — negotiator scores well across adoption, maintenance, weight, supply chain, and licensing. 203.7M downloads per week and 2 known dependents. Last published 20 days ago. 2 releases in the last 2 years.
How do I install negotiator?
Run `npm install negotiator` to add negotiator to your npm project.
How many dependencies does negotiator have?
negotiator declares 6 direct dependencies and pulls in 1 packages in total once its runtime tree is resolved totalling about 46 KB on disk.
What license is negotiator released under?
negotiator is distributed under the MIT license.
How popular is negotiator?
negotiator has approximately 203,664,219 downloads per week and 2 known dependent packages.
Is negotiator still maintained?
The most recent release of negotiator (v1.1.0) was published 20 days ago.
Does negotiator run install scripts?
No. negotiator does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.