Socket
Socket
Sign inDemoInstall

is-deflate

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-deflate

Detect if a Buffer/Uint8Array is compressed using deflate


Version published
Weekly downloads
3.5M
decreased by-0.75%
Maintainers
1
Install size
3.44 kB
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 23 Jan 2016

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc