# is-deflate

> Detect if a Buffer/Uint8Array is compressed using deflate

Latest version **1.0.0** (published 2016-01-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-deflate
pnpm add is-deflate
yarn add is-deflate
bun add is-deflate
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-01-23 |
| First published | 2016-01-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/is-deflate) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Thomas Watson Steen |
| Maintainers | watson |
| Keywords | deflate, inflate, compression, zlib, test |

## Links

- npm: https://www.npmjs.com/package/is-deflate
- Repository: https://github.com/watson/is-deflate
- Homepage: https://github.com/watson/is-deflate#readme
- Issues: https://github.com/watson/is-deflate/issues
- npm.io page: https://npm.io/package/is-deflate

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-01-23

## README

# is-deflate

Check if a given `Buffer` or `Uint8Array` is
[deflate](https://en.wikipedia.org/wiki/DEFLATE) compressed.

[![Build status](https://travis-ci.org/watson/is-deflate.svg?branch=master)](https://travis-ci.org/watson/is-deflate)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

## Installation

```
npm install is-deflate --save
```

## Usage

```js
var fs = require('fs')
var zlib = require('zlib')
var isDeflate = require('is-deflate')

var buf = fs.readFileSync('my-file')

if (isDeflate(buf)) {
  zlib.inflate(buf, function (err, data) {
    if (err) throw err
    console.log(data)
  })
}
```

## License

MIT

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