Skip to content

kokhinmaungwin/node-zip-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Zip Helper

A simple utility library for creating and extracting ZIP files in Node.js environments.


Installation

npm install @kokhinmaungwin/node-zip-helper

Usage

const zipHelper = require('@kokhinmaungwin/node-zip-helper');

// Example: Create a zip archive
zipHelper.createZip(['file1.txt', 'file2.txt'], 'archive.zip')
  .then(() => console.log('ZIP created successfully'))
  .catch(console.error);

// Example: Extract a zip archive
zipHelper.extractZip('archive.zip', './extracted')
  .then(() => console.log('ZIP extracted successfully'))
  .catch(console.error);

API

  • createZip(filesArray, outputZipPath):
  • Creates a zip file from an array of file paths.
  • extractZip(zipFilePath, outputDir):
  • Extracts the content of a zip file to the specified directory.

License

MIT License © Khin Maung Win

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors