ArchiverJS is a lightweight Node.js library for compressing and extracting directories with support for .tar.gz, .zip, and .7z formats, powered by a promise-based API for seamless async/await usage (docs.npmjs.com). It aims to simplify archive workflows in Node.js projects by providing a single, intuitive interface for multiple archive types (Bits and Pieces).
Install ArchiverJS via npm:
npm install archiverjs --saveThis adds ArchiverJS to your project’s dependencies (docs.npmjs.com).
Import and use the compress and extract functions with async/await:
import { compress, extract } from 'archiverjs';
await compress('mydir'); // create mydir.tar.gz
await compress('mydir', 'mydir.tar.gz');
await compress('mydir', 'mydir.zip');
await compress('mydir', 'mydir.7z');
await extract('mydir.tar.gz');
await extract('mydir.zip');
await extract('mydir.7z');This pattern follows typical Node.js module usage guidelines for clarity and consistency (Bits and Pieces).
- Promise-based API for easy async/await integration (Bits and Pieces)
- Multi-format support:
.tar.gz,.zip, and.7z(Bits and Pieces) - No external CLI dependencies: all operations run via native Node.js packages (Bits and Pieces)
Compresses the specified directory (inputDir) into the archive file at outputPath. Supported extensions: .tar.gz, .zip, .7z (arXiv).
Extracts the given archive (archivePath) into destDir (defaults to current directory). Automatically detects and handles .tar.gz, .zip, and .7z formats (arXiv).
Contributions, bug reports, and feature requests are welcome via GitHub pull requests or issues: https://github.com/GitHub30/archiverjs/issues (Bits and Pieces).
Open GitHub Codespaces
npm adduser
npm publish --access publicThis project is licensed under the MIT License. See LICENSE for details (docs.npmjs.com).