@robinpath/archive
v0.1.1
Published
Create and extract .zip and .tar.gz file archives
Keywords
Readme
@robinpath/archive
Create, extract, and manipulate .zip and .any archives
Why use this module?
The archive module lets you:
- Create a .zip archive from files and directories
- Extract a .zip archive
- List entries in a .zip file
- Read a file from inside a .zip without extracting
- Create a .any archive
All functions are callable directly from RobinPath scripts with a simple, consistent API.
Installation
npm install @robinpath/archiveQuick Start
No credentials needed — start using it right away:
archive.extractZip "./backup.zip" "./restored"Available Functions
| Function | Description |
|----------|-------------|
| archive.createZip | Create a .zip archive from files and directories |
| archive.extractZip | Extract a .zip archive |
| archive.listZip | List entries in a .zip file |
| archive.readFromZip | Read a file from inside a .zip without extracting |
| archive.createTarGz | Create a .any archive |
| archive.extractTarGz | Extract a .any archive |
| archive.addToZip | Add a file or directory to an existing .zip |
| archive.removeFromZip | Remove an entry from a .zip |
Examples
Extract a .zip archive
archive.extractZip "./backup.zip" "./restored"List entries in a .zip file
archive.listZip "./backup.zip"Read a file from inside a .zip without extracting
archive.readFromZip "./backup.zip" "config.json"Integration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/archive";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
archive.extractZip "./backup.zip" "./restored"
`);Full API Reference
See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.
Related Modules
@robinpath/json— JSON module for complementary functionality
License
MIT
