Offline-first package caching and distribution CLI for JavaScript and TypeScript developers.
Built by Shoaib — Developer tools for the next generation.
🌐 Website: https://pack-vault-website.vercel.app/
PackVault is an offline-first package caching and distribution library for JavaScript developers. Download package tarballs while online, install them later without internet access, share them across your LAN, and bootstrap entire projects from a local package vault.
- ⭐ Offline-first: Cache packages online, use them completely offline.
- 🌐 LAN package sharing: Share packages over the local network via mDNS.
- 📦 Project templates: Bootstrap projects with dependencies completely offline.
- 🔒 Integrity verification: Ensures SHA-512 and shasum consistency.
- ⚡ Peer-to-peer package sync: P2P synchronization with authorization tokens.
You can install PackVault programmatically using JSR: npx jsr add @shoaib/packvault
For Deno: deno add jsr:@shoaib/packvault
npm install -g packvault
packvault sync react vite tailwindcss
Or sync directly from a lockfile: packvault sync --from-lockfile
Disconnect from the internet.
packvault install react
packvault sync react vite tailwindcss packvault sync --from-lockfile packvault sync --concurrency 10
packvault install react packvault install vite
packvault bundle save my-stack react vite tailwindcss packvault bundle list
packvault search react
import { CacheManager } from "@shoaib/packvault";
async function cachePackages() { const cache = new CacheManager(); await cache.syncPackages(["vite", "typescript"]);
const pkgPath = await cache.getPackagePath("vite", "latest"); console.log("Vite is cached at:", pkgPath); }
cachePackages();
import { PackageManager } from "@shoaib/packvault";
async function runOffline() { const manager = new PackageManager(); const pkg = await manager.installOffline("react", "^18.0.0"); console.log("Offline installation successful!", pkg); }
runOffline();
The default configuration is stored in ~/.packvault/config.json. You can modify it or use environment variables to adjust cache paths, registry URLs, and peer-to-peer settings.
Example: { "cacheDirectory": "~/.packvault/cache", "registry": "https://registry.npmjs.org/", "p2pPort": 8000 }
npm Registry │ ▼ PackVault Sync │ ▼ Local Vault │ ┌────┴────┐ ▼ ▼ Offline LAN Install Sharing │ ▼ Peer Sync
The core components include:
- CacheManager: Handles metadata and tarball caching.
- PackageManager: Orchestrates installations.
- PeerManager: Discovers and syncs with peers via mDNS.
- LocalRegistryServer: Exposes the local cache as a standard npm registry.
We provide several executable examples in the examples/ directory:
- basic.ts - Basic package resolution.
- cache.ts - Sync and caching workflow.
- offline.ts - Demonstrates offline installation fallback.
- sync.ts - Peer-to-peer LAN syncing.
- template.ts - Offline template scaffolding.
- Q: Does PackVault replace npm or Yarn?
A: No, it works alongside them. It acts as a smart cache and offline registry proxy. - Q: Can I use it in CI environments?
A: Yes! You can point PackVault to a shared cache directory to drastically speed up CI times. - Q: Is it compatible with Deno and Bun?
A: Yes, PackVault's core APIs and CLI are designed to be runtime agnostic where possible.
We welcome contributions from developers of all levels. Please check our GitHub Issues and read the CONTRIBUTING.md guidelines.
MIT — See LICENSE
- Core offline caching
- Lockfile sync
- Integrity verification
- Project templates
- LAN package sharing (mDNS)
- Classroom mode
- Web dashboard