pkg-deps
v2.0.1
Published
A CLI tool to bundle packages and their dependencies for offline and air-gapped environments.
Maintainers
Readme
Pkg Deps
A CLI tool to download packages and their dependencies for offline use.
Supported Package Managers
- NPM (Node.js)
- Pip (Python)
- Maven (Java)
- NuGet (.NET)
- Docker (Images)
- APK (Alpine Linux)
Prerequisites
The underlying package managers must be installed and available in your system's PATH:
npmfor NPM packagespipfor Python packagesmvnfor Maven packagesnugetfor NuGet packagesdockerfor Docker imagesapkfor Alpine packages (must be run on Alpine Linux)
Installation
npm install -g pkg-depsUsage
pkg-deps <command> [options]Commands
npm: Bundle NPM packagepip: Bundle Python packagemaven: Bundle Maven packagenuget: Bundle NuGet packagedocker: Bundle Docker packageapk: Bundle APK package
Global Options
These options are available for all commands:
-p, --package <name>: Package name (Required)-v, --version <version>: Package version (Optional, defaults to latest)-o, --output <path>: Custom output directory (Optional)-r, --repo <url>: Repository URL (for private/custom registries)-u, --username <user>: Repository username-P, --password <pass>: Repository password-h, --help: Display help
Output Directory
By default, bundles are created in a bundles/ subdirectory within the current working directory, following the naming convention:
bundles/<safe-package-name>-<version>-bundle/
You can override this location using the --output flag.
Examples
NPM
pkg-deps npm --package axios --version 1.0.0Creates bundles/axios-1.0.0-bundle/ containing .tgz files.
Python (Pip)
pkg-deps pip --package requests --version 2.31.0Creates bundles/requests-2.31.0-bundle/ containing whl/tar.gz files.
Java (Maven)
pkg-deps maven --package org.mockito:mockito-core --version 5.10.0Creates bundles/mockito-core-5.10.0-bundle/ containing JARs and POMs.
Private Repository Example
pkg-deps npm \
--package @myorg/private-pkg \
--repo https://registry.myorg.com \
--username myuser \
--password mypassExtra Arguments
Any additional arguments passed to the CLI will be forwarded to the underlying package manager command.
pkg-deps npm --package axios -- --registry=https://registry.npmmirror.com