Socket
Book a DemoInstallSign in
Socket

zip-a-folder

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zip-a-folder

Zip/Tar a complete folder or a glob list into a zip/tgz file

latest
Source
npmnpm
Version
3.1.9
Version published
Weekly downloads
192K
-5.16%
Maintainers
1
Weekly downloads
 
Created

What is zip-a-folder?

The zip-a-folder npm package allows you to easily zip folders in Node.js applications. It provides a simple API to compress directories into zip files, making it useful for tasks such as creating backups, packaging files for distribution, or preparing files for upload.

What are zip-a-folder's main functionalities?

Zip a folder

This feature allows you to zip a folder by specifying the source directory and the destination zip file path. The code sample demonstrates how to use the `zip` function to compress a folder.

const { zip } = require('zip-a-folder');

async function zipFolder() {
  await zip('/path/to/source/folder', '/path/to/destination/archive.zip');
}

zipFolder();

Zip a folder with a callback

This feature allows you to zip a folder and handle the completion with a callback function. The code sample demonstrates how to use the `zip` function with a callback to handle errors and success messages.

const { zip } = require('zip-a-folder');

zip('/path/to/source/folder', '/path/to/destination/archive.zip', (err) => {
  if (err) {
    console.error('Error zipping folder:', err);
  } else {
    console.log('Folder successfully zipped');
  }
});

Other packages similar to zip-a-folder

Keywords

zip

FAQs

Package last updated on 19 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts