Skip to content

musicslayer/zip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zip

Quick and easy nodejs functions to work with zip files.

This combines "node-compress-commons" and "buffer-crc32" to provide streamlined zip/unzip functionality that does not require any external modules.

https://github.com/archiverjs/node-compress-commons

https://github.com/brianloveswords/buffer-crc32

Installation Instructions

Package available on NPM.

> npm install @musicslayer/zip

Example Usage

Refer to example.js to see an example usage of each function in the API.

API

Zip.createZipFileFromFolder(zipFilePath, srcFolder, compressionLevel)

Creates a zip file containing a folder and all of its content. Compression level is an integer 0-9 refering to the zlib compression level:

0 = No compression
1 = Fastest Compression
...
9 = Maximum Compression

Zip.computeZipFile(srcFolder, compressionLevel)

Computes the compressed file information as if you called "Zip.createZipFileFromFolder", but will not actually create a zip file on disk.

Unzip.extractZipFileIntoFolder(zipFilePath, destFolder)

Extracts a zip file, writing all of its contents into a specified folder.

Unzip.readZipFile(zipFilePath)

Reads data from a zip file, returning a Map of file names to each file's information and uncompressed contents without extracting any files on disk.

About

Quick and easy nodejs functions to work with zip files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors