A simple utility library for creating and extracting ZIP files in Node.js environments.
npm install @kokhinmaungwin/node-zip-helperconst 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);- 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.
MIT License © Khin Maung Win