TarGz for NodeJS
Simple tar.gz compression and decompression for NodeJS.
Installation
npm install targz
Simple Usage
var targz = ; // compress files into tar.gz archivetargz; // decompress files from tar.gz archivetargz;
Advanced Usage
You can adjust tar and gzip/gunzip parameters by using optional parameters. The API:
// Compress APItargz; // Decompress APItargz;
Where supported options are:
- src - (String) The path to files to be compressed
- dest - (String) The path to tar.gz file to be created
- tar - (Object) Adjust tar options. See tar-fs docs for details. OPTIONAL.
- ignore - (Function) Ignore/filter files
- entries - (Array) Define list of files
- map - (Function) Modify the headers
- mapStream - (Function) Modify the input/output file streams
- dmode - (Number) Set the permissions for directories
- fmode - (Number) Set permissions for files
- strict - (Boolean) Ignore errors due to unsupported entry types (like device files). Default: true
- dereference - (Boolean) Pack the contents of the symlink instead of the link itself. Default: false
- gz - (Object) Adjust gzip/gunzip options. See zlib docs for details. OPTIONAL.
Example
var targz = ; // compress files into tar.gz archive while filtering all .bin files and having gzip level/memLevel set to 6targz;
License
MIT