# compressible

> Compressible Content-Type / mime checking

Latest version **2.0.18** (published 2020-01-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install compressible
pnpm add compressible
yarn add compressible
bun add compressible
```

## Health

**Score 33/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.18 |
| Published | 2020-01-06 |
| First published | 2013-12-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/compressible) |
| Module format | CommonJS |
| Node | >= 0.6 |
| Dependencies | 1 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 103 |
| Maintainers | dougwilson, fishrock123, jongleberry |
| Keywords | compress, gzip, mime, content-type |

## Links

- npm: https://www.npmjs.com/package/compressible
- Repository: https://github.com/jshttp/compressible
- Homepage: https://github.com/jshttp/compressible#readme
- Issues: https://github.com/jshttp/compressible/issues
- npm.io page: https://npm.io/package/compressible

## Dependencies (1)

- [mime-db](https://npm.io/package/mime-db.md) >= 1.43.0 < 2

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 2.0.18 (latest) — 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
- … 11 more at https://npm.io/package/compressible/versions

## README

# compressible

[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]

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

## Installation

```sh
$ npm install compressible
```

## API

<!-- eslint-disable no-unused-vars -->

```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.

<!-- eslint-disable no-undef -->

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

## License

[MIT](LICENSE)

[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/compressible/master
[coveralls-url]: https://coveralls.io/r/jshttp/compressible?branch=master
[node-version-image]: https://badgen.net/npm/node/compressible
[node-version-url]: https://nodejs.org/en/download
[npm-downloads-image]: https://badgen.net/npm/dm/compressible
[npm-url]: https://npmjs.org/package/compressible
[npm-version-image]: https://badgen.net/npm/v/compressible
[travis-image]: https://badgen.net/travis/jshttp/compressible/master
[travis-url]: https://travis-ci.org/jshttp/compressible

---
_Source: https://npm.io/package/compressible · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
