Socket
Socket
Sign inDemoInstall

is-gzip

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-gzip

Check if a Buffer/Uint8Array is a GZIP file


Version published
Weekly downloads
3M
decreased by-1.06%
Maintainers
1
Weekly downloads
 
Created

What is is-gzip?

The is-gzip npm package is a simple utility that allows you to check if a given buffer is compressed using the gzip compression algorithm. It is useful when you need to determine the compression of data programmatically, especially when dealing with streams or files that may or may not be gzipped.

What are is-gzip's main functionalities?

Check if a buffer is gzipped

This feature allows you to check if a buffer (for example, the contents of a file read into memory) is gzipped. The function returns a boolean value indicating whether the buffer is gzipped or not.

const isGzip = require('is-gzip');
const fs = require('fs');

fs.readFile('file.gz', (err, data) => {
  if (err) throw err;
  console.log(isGzip(data)); // true or false
});

Other packages similar to is-gzip

Keywords

FAQs

Package last updated on 25 Aug 2014

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc