> For the complete documentation index, see [llms.txt](https://bryan-guner.gitbook.io/my-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bryan-guner.gitbook.io/my-docs/redux/repos/examples/real-world/node_modules/compressible.md).

# compressible

[![NPM Version](https://badgen.net/npm/v/compressible)](https://npmjs.org/package/compressible) [![NPM Downloads](https://badgen.net/npm/dm/compressible)](https://npmjs.org/package/compressible) [![Node.js Version](https://badgen.net/npm/node/compressible)](https://nodejs.org/en/download) [![Build Status](https://badgen.net/travis/jshttp/compressible/master)](https://travis-ci.org/jshttp/compressible) [![Test Coverage](https://badgen.net/coveralls/c/github/jshttp/compressible/master)](https://coveralls.io/r/jshttp/compressible?branch=master)

Compressible `Content-Type` / `mime` checking.

## Installation

```
$ npm install compressible
```

## API

```js
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`](https://www.npmjs.com/package/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.

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

## License

[MIT](https://github.com/bgoonz/Learning-Redux/blob/master/repos/examples/real-world/node_modules/compressible/LICENSE/README.md)
