Socket
Book a DemoInstallSign in
Socket

is-deflate

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-deflate

Detect if a Buffer/Uint8Array is compressed using deflate

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
1M
-10.6%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

deflate

FAQs

Package last updated on 23 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts