
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
encoding-negotiator
Advanced tools
npm i encoding-negotiator -S
import negotiateEncoding from 'encoding-negotiator';
negotiateEncoding({
header: 'compress;q=0.5, gzip;q=1.0',
supportedEncodings: ['gzip', 'deflate', 'identity']
); //returns gzip
Returns the most preffered encoding available in supportedEncodings
The first
element of the supportedEncodings
array will be used in case of an asterisk.
The accept-encoding
header.
An array of the supported encodings.
An encoding preffered by the server if the client sends multiple encodings no
quality value (for example Accept-Encoding: gzip, deflate, br
).
$ node benchmark/benchmark.js
negotiator x 863,149 ops/sec ±0.40% (99 runs sampled)
encoding-negotiator x 2,346,708 ops/sec ±0.53% (98 runs sampled)
Fastest is encoding-negotiator
FAQs
a negotiator for the accept-encoding header
The npm package encoding-negotiator receives a total of 67,253 weekly downloads. As such, encoding-negotiator popularity was classified as popular.
We found that encoding-negotiator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.