compressible

Compressible Content-Type / mime checking

MIT 26 个版本
安装
npm install compressible
yarn add compressible
pnpm add compressible
bun add compressible
README

compressible

NPM Version NPM Downloads Node.js Version Build Status Test Coverage

Compressible Content-Type / mime checking.

Installation

$ npm install compressible

API

var compressible = require('compressible')

compressible(type)

Checks if the given Content-Type is compressible. The type argument is expected to be a value MIME type or Content-Type string, though no validation is performed.

The MIME is looked up in the mime-db and if there is compressible information in the database entry, that is returned. Otherwise, this module will fallback to true for the following types:

  • text/*
  • */*+json
  • */*+text
  • */*+xml

If this module is not sure if a type is specifically compressible or specifically uncompressible, undefined is returned.

compressible('text/html') // => true
compressible('image/png') // => false

License

MIT

版本列表
2.0.18 2020-01-06
2.0.17 2019-04-24
2.0.16 2019-02-18
2.0.15 2018-09-17
2.0.14 2018-06-05
2.0.13 2018-02-18
2.0.12 2017-10-20
2.0.11 2017-07-28
2.0.10 2017-03-24
2.0.9 2016-10-31
2.0.8 2016-05-12
2.0.7 2016-01-19
2.0.6 2015-09-30
2.0.5 2015-07-31
2.0.4 2015-07-02
2.0.3 2015-06-08
2.0.2 2015-02-01
2.0.1 2014-10-04
2.0.0 2014-09-02
1.1.1 2014-08-06
1.1.0 2014-06-04
1.0.1 2014-03-21
1.0.0 2014-01-01
0.2.0 2013-12-23
0.1.1 2013-12-19
0.1.0 2013-12-19