JSPM

encoding-negotiator

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 90833
  • Score
    100M100P100Q167260F
  • License MIT

a negotiator for the accept-encoding header

Package Exports

  • encoding-negotiator

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (encoding-negotiator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

encoding-negotiator

Install

Greenkeeper badge Build Status Coverage Status NPM version

npm install encoding-negotiator

Example

const encodingNegotiator = require('encoding-negotiator');

encodingNegotiator.negotiate('compress;q=0.5, gzip;q=1.0', ['gzip', 'deflate']); //returns gzip

API

negotiate(header, supported)

Returns the most preffered encoding available in supported The first element of the supported array will be used in case of an asterisk.

The accept-encoding header.

supported

An array of the supported encodings.

License

MIT