Skip to content

jmjuanes/gzipy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gzipy

A basic GZip compress and decompress library

npm npm

Install

You can install the latest version of the package using npm:

$ npm install --save gzipy

Usage

//Import gzipy 
var gzipy = require('gzipy');

//Compress a file 
gzipy.compress('./file.txt', './file.txt.gz', function(error)
{
  //Handle the error 
  if(error){ /* Something went wrong... */ } 
  
  console.log('File compressed!');
});

//Decompress a file
gzipy.decompress('./document.pdf.gz', './document.pdf', function(error)
{
  //Handle the error 
  if(error){ /* Something went wrong... */ } 
  
  console.log('File decompressed');
});

API

gzipy.compress(input, output, callback)

Compress the input file and save it to output. The callback method will be called when the process is completed or when there is an error.

gzipy.decompress(input, output, callback)

Decompress the input file and save it to output. The callback method will be called when the process is completed or when there is an error.

License

Under the MIT LICENSE.

About

A basic GZip compress and decompress library

Resources

License

Stars

Watchers

Forks

Packages

No packages published