@robinpath/archive
Advanced tools
+91
| # @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 | ||
| ```bash | ||
| npm install @robinpath/archive | ||
| ``` | ||
| ## Quick Start | ||
| No credentials needed — start using it right away: | ||
| ```robinpath | ||
| 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 | ||
| ```robinpath | ||
| archive.extractZip "./backup.zip" "./restored" | ||
| ``` | ||
| ### List entries in a .zip file | ||
| ```robinpath | ||
| archive.listZip "./backup.zip" | ||
| ``` | ||
| ### Read a file from inside a .zip without extracting | ||
| ```robinpath | ||
| archive.readFromZip "./backup.zip" "config.json" | ||
| ``` | ||
| ## Integration with RobinPath | ||
| ```typescript | ||
| 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](./MODULE.md) for complete documentation including all parameters, return types, error handling, and advanced examples. | ||
| ## Related Modules | ||
| - [`@robinpath/json`](../json) — JSON module for complementary functionality | ||
| ## License | ||
| MIT |
+32
-8
| { | ||
| "name": "@robinpath/archive", | ||
| "version": "0.1.0", | ||
| "version": "0.1.1", | ||
| "description": "Create and extract .zip and .tar.gz file archives", | ||
| "publishConfig": { "access": "public" }, | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "type": "module", | ||
| "main": "dist/index.js", | ||
| "types": "dist/index.d.ts", | ||
| "exports": { ".": { "import": "./dist/index.js", "types": "./dist/index.d.ts" } }, | ||
| "files": ["dist"], | ||
| "scripts": { "build": "tsc", "test": "node --import tsx --test tests/*.test.ts" }, | ||
| "peerDependencies": { "@wiredwp/robinpath": ">=0.20.0" }, | ||
| "dependencies": { "archiver": "^7.0.0", "adm-zip": "^0.5.0", "tar": "^7.0.0" }, | ||
| "devDependencies": { "@wiredwp/robinpath": "^0.30.1", "@types/archiver": "^6.0.0", "@types/adm-zip": "^0.5.0", "tsx": "^4.19.0", "typescript": "^5.6.0" } | ||
| "exports": { | ||
| ".": { | ||
| "import": "./dist/index.js", | ||
| "types": "./dist/index.d.ts" | ||
| } | ||
| }, | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "scripts": { | ||
| "build": "tsc", | ||
| "test": "node --import tsx --test tests/*.test.ts" | ||
| }, | ||
| "peerDependencies": { | ||
| "@wiredwp/robinpath": ">=0.20.0" | ||
| }, | ||
| "dependencies": { | ||
| "archiver": "^7.0.0", | ||
| "adm-zip": "^0.5.0", | ||
| "tar": "^7.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@wiredwp/robinpath": "^0.30.1", | ||
| "@types/archiver": "^6.0.0", | ||
| "@types/adm-zip": "^0.5.0", | ||
| "tsx": "^4.19.0", | ||
| "typescript": "^5.6.0" | ||
| } | ||
| } |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
25266
10.8%10
11.11%0
-100%92
Infinity%1
Infinity%