Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cross-zip

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cross-zip

Cross-platform .zip file creation

  • 2.1.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
203K
decreased by-5.7%
Maintainers
1
Weekly downloads
 
Created

What is cross-zip?

The cross-zip npm package is a utility for zipping and unzipping files and directories in a cross-platform manner. It is designed to work seamlessly on both Windows and Unix-like systems, making it a versatile tool for handling zip files in Node.js applications.

What are cross-zip's main functionalities?

Zip a directory

This feature allows you to zip an entire directory. The code sample demonstrates how to zip a directory named 'sourceDir' into a file named 'output.zip'.

const crossZip = require('cross-zip');
crossZip.zip('sourceDir', 'output.zip', (err) => {
  if (err) {
    console.error('Error zipping directory:', err);
  } else {
    console.log('Directory zipped successfully');
  }
});

Unzip a file

This feature allows you to unzip a zip file into a specified directory. The code sample demonstrates how to unzip a file named 'input.zip' into a directory named 'destinationDir'.

const crossZip = require('cross-zip');
crossZip.unzip('input.zip', 'destinationDir', (err) => {
  if (err) {
    console.error('Error unzipping file:', err);
  } else {
    console.log('File unzipped successfully');
  }
});

Other packages similar to cross-zip

Keywords

FAQs

Package last updated on 22 Jun 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc