Cross-platform Zip/Unzip CLI

1.0.0 · maintenance · verified Wed Apr 22

cross-zip-cli is a command-line interface wrapper for the `cross-zip` library, designed to provide consistent cross-platform directory zipping and unzipping capabilities. It exposes two main commands: `cross-zip` for compression and `cross-unzip` for decompression. This tool is particularly valuable for developers writing `npm` scripts or other automated build processes that need to function identically across Windows, macOS, and Linux environments, abstracting away the underlying operating system's native archiving utilities. The current stable version is 1.0.0, and it appears to be in a maintenance state with no recent updates since 2021. Its primary differentiator is its focus on simplifying cross-platform archival tasks within automated workflows, ensuring reliability and compatibility regardless of the host OS.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to install `cross-zip-cli` and then use its `cross-zip` and `cross-unzip` commands within `npm` scripts to create a test directory, archive it, and then extract its contents, ensuring cross-platform compatibility.

{}
{
  "name": "my-project",
  "version": "1.0.0",
  "scripts": {
    "install-cli": "npm install -g cross-zip-cli",
    "create-test-dir": "mkdir -p ./temp/data && echo 'Hello, world!' > ./temp/data/hello.txt && echo 'Another file.' > ./temp/data/another.txt",
    "zip-data": "cross-zip ./temp/data ./temp/archive.zip",
    "unzip-data": "cross-unzip ./temp/archive.zip ./temp/extracted",
    "clean": "rm -rf ./temp"
  }
}
```

```bash
# Install the CLI globally (or use npx for local execution)
npm run install-cli

# Create a dummy directory with files
npm run create-test-dir

# Zip the 'data' directory into 'archive.zip'
npm run zip-data

# Unzip 'archive.zip' into a new 'extracted' directory
npm run unzip-data

# Clean up temporary files
npm run clean
```

view raw JSON →