JSPM

is-deflate

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2997477
  • Score
    100M100P100Q204407F
  • License MIT

Detect if a Buffer/Uint8Array is compressed using deflate

Package Exports

  • is-deflate

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 (is-deflate) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

is-deflate

Check if a given Buffer or Uint8Array is deflate compressed.

Build status js-standard-style

Installation

npm install is-deflate --save

Usage

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