Registry / devops / cross-zip-cli

cross-zip-cli

JSON →
library1.0.0jsnpmunverified

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.

npm install cross-zip-cli
INSTALL
IMPORT
SIG · CROSS-ZIP-CLI
C
cross-zip-cli
devopsjavascriptv1.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cross-zip
n/a (CLI executable)
import { crossZip } from 'cross-zip-cli';
This package provides command-line executables ('cross-zip', 'cross-unzip') which are invoked directly from the shell or npm scripts. It does not export JavaScript symbols for programmatic use via `import` or `require`.
cross-unzip
n/a (CLI executable)
const crossUnzip = require('cross-zip-cli').unzip;
The decompression functionality is accessed via the 'cross-unzip' command in your terminal after global installation or via npx, not through JavaScript imports or CommonJS `require` calls.
Package Root
n/a (CLI package)
import crossZipCli from 'cross-zip-cli';
Attempting to import the root of the 'cross-zip-cli' package will result in an empty or undefined module, as its purpose is solely to provide executable scripts for the command line.

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 ```
cross-zip --version
Debug
Known issues
gotchaWhen installing, `cross-zip-cli` is primarily designed for global installation (`npm install -g cross-zip-cli`) or execution via `npx` (e.g., `npx cross-zip-cli`). If installed locally without using `npx`, the commands may not be directly available in your shell's PATH without specifying `./node_modules/.bin/cross-zip`.
fix
Always install globally with `npm install -g cross-zip-cli` or use `npx cross-zip` (after a local `npm install cross-zip-cli`) to ensure commands are executable.
affects: >=1.0.0
gotchaPaths containing spaces must be enclosed in double quotes (e.g., `"./my folder/data"`) when passed as arguments to `cross-zip` or `cross-unzip`, especially on Windows, to prevent misinterpretation of the arguments.
fix
Quote any path arguments that contain spaces or special characters: `cross-zip "./path with spaces/input" "./path with spaces/output.zip"`.
affects: >=1.0.0
gotchaThe `cross-zip-cli` tool currently does not provide a progress indicator during zipping or unzipping operations. For very large directories or files, the command may appear to hang, leading to uncertainty about its status.
fix
Monitor the file system for changes (e.g., new zip file appearing, target directory growing) or run in a background process if non-blocking execution is required. Consider piping output to a log file for long operations.
affects: >=1.0.0
gotchaBy default, `cross-zip` will overwrite an existing destination zip file without prompting. This can lead to unintended data loss if the target file path is already in use.
fix
Ensure your build scripts or manual commands check for the existence of the destination zip file (e.g., using `test -f file.zip || cross-zip ...`) or use temporary filenames to prevent accidental overwrites.
affects: >=1.0.0
Errors
Common errors & fixes
'cross-zip' is not recognized as an internal or external command, operable program or batch file.
The `cross-zip` command (or `cross-unzip`) is not found in your system's PATH. This typically happens if the package was installed locally and you are not calling it via `npx` or the `./node_modules/.bin` directory, or if a global installation failed.
fix
If installed locally, use `npx cross-zip` or run it from `$(npm bin)/cross-zip`. For global access, ensure it's installed globally with `npm install -g cross-zip-cli` and that your npm global bin directory is in your system's PATH.
Error: Input directory does not exist: /path/to/nonexistent
The source directory specified for zipping with `cross-zip` does not exist at the provided path.
fix
Verify that the input directory path is correct and that the directory actually exists before running the `cross-zip` command.
Error: zip file not found: /path/to/nonexistent.zip
The source zip file specified for unzipping with `cross-unzip` does not exist at the provided path.
fix
Verify that the input zip file path is correct and that the file actually exists before running the `cross-unzip` command.
Error: Cannot create zip file: EACCES: permission denied, open '/path/to/output.zip'
The user executing the command does not have sufficient write permissions to create the output zip file or directory at the specified destination.
fix
Change the output directory to one where the current user has write permissions, or adjust the file system permissions for the target directory.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
cross-ziprequiredCore zipping/unzipping logic is provided by this underlying library.
Agent activity
7 hits · last 30 days
node
7
Resources
cross-zip-cli — npm install cross-zip-cli · libregistry