Blazingly fast package installation for Node.js
A fast, drop-in replacement for npm install, focused on drastically speeding up Node.js dependency installation through deterministic caching, parallel operations, and .flashpack archive snapshotting.
- Blazing Fast: Installs dependencies from cache when available, avoiding network requests
- Deterministic Caching: Uses hash-based paths for deduplication and hardlinks to minimize disk usage
- Parallel Operations: Installs packages in parallel using Node.js worker threads
- Snapshot Support: Creates and restores
.flashpackarchives for instant dependency restoration - Package Manager Compatibility: Works with npm, yarn, and pnpm projects
- Monorepo Support: Enhanced workspace detection, parallel installation across workspaces, and intelligent dependency hoisting
- Enhanced Offline Mode: Install dependencies without internet connection with intelligent network detection and fallback strategies
- Checksum Validation: Verifies package integrity against npm registry checksums
- Snapshot Fingerprinting: Auto-invalidates snapshots when lockfiles change
- Sync Command: Efficiently updates dependencies without full reinstallation
- Enhanced Plugin System: Extensible architecture with lifecycle hooks, auto-discovery, and plugin registry
- Cloud Cache Integration: Store and retrieve caches from cloud storage (S3, Azure, GCP) with team sharing capabilities
- Dependency Analysis: Visualization of dependency graphs, detection of duplicates, and size analysis
npm install -g @flash-install/cliReplace your regular npm install command with flash-install:
# Standard installation
flash-install
# Or use direct mode for better progress reporting
flash-directInstall individual packages just like with npm:
# Install packages
flash-install express react
# Install with specific version
flash-install lodash@4.17.21
# Save to dependencies (default)
flash-install axios --save
# Save to devDependencies
flash-install jest --save-dev
# Save exact version
flash-install typescript@5.0.4 --save-exactCreate a .flashpack snapshot of your node_modules directory:
flash-install snapshot
# Skip adding to global cache
flash-install snapshot --no-cache
# Set a custom timeout for the cache operation (in seconds)
flash-install snapshot --cache-timeout 10Restore your node_modules from a .flashpack snapshot:
flash-install restoreRemove both node_modules and local .flashpack file:
flash-install cleanNote: The clean command removes both the node_modules directory and the snapshot file. You'll need to create a new snapshot after cleaning if you want to use the restore command later.
Remove only the node_modules directory (preserves snapshot):
flash-install clean-modulesThis is useful when you want to free up disk space but keep the snapshot for quick restoration later.
Remove only the snapshot file (preserves node_modules):
flash-install clean-snapshotThis is useful when you want to create a fresh snapshot without removing your installed dependencies.
Clean the global cache:
flash-install clean --globalNote: The
clean-modulesandclean-snapshotcommands are now available in both the main CLI interface and the direct CLI interface. Previously, they were only available in the direct CLI interface.
Efficiently update dependencies without a full reinstall:
flash-install syncView information about the global cache:
flash-install cacheVerify cache integrity:
flash-install cache --verifyOptimize cache storage:
flash-install cache --optimizeSynchronize your cache with cloud storage:
# Sync with default settings (both upload and download)
flash-install cloud-sync --cloud-bucket=your-bucket-name
# Upload only
flash-install cloud-sync --direction=upload --cloud-bucket=your-bucket-name
# Download only
flash-install cloud-sync --direction=download --cloud-bucket=your-bucket-name
# Force synchronization even if files exist
flash-install cloud-sync --force --cloud-bucket=your-bucket-name
# Use a specific cloud provider
flash-install cloud-sync --cloud-provider=azure --cloud-bucket=your-container-name
# Team sharing with access controls
flash-install cloud-sync --team-id=your-team --team-token=your-token --team-access-level=writeSee the cloud cache documentation for more details.
Flash Install provides tools for analyzing and visualizing dependencies:
# Analyze dependencies and show statistics
flash-install analyze
# Visualize dependency tree
flash-install deps
# Generate a DOT graph for Graphviz
flash-install deps --format dot --output deps.dot
# Generate a Markdown report
flash-install deps --format markdown --output deps.mdSee the dependency analysis documentation for more details.
Check network availability and registry status:
# Check network status
flash-install networkFlash Install provides robust support for monorepos and workspaces:
# Install dependencies with workspace support
flash-install -w
# List all workspace packages
flash-install workspaces
# Install with custom workspace options
flash-install -w --no-hoist --workspace-concurrency 8See the monorepo documentation for more details.
List installed plugins:
flash-install plugin listAdd a plugin:
flash-install plugin add <path-to-plugin>Remove a plugin:
flash-install plugin remove <plugin-name>-o, --offline: Use offline mode (requires cache or snapshot)--no-cache: Disable cache usage-c, --concurrency <number>: Number of concurrent installations-p, --package-manager <manager>: Package manager to use (npm, yarn, pnpm)--no-dev: Skip dev dependencies--skip-postinstall: Skip postinstall scripts-v, --verbose: Enable verbose logging-q, --quiet: Suppress all output except errors
-w, --workspace: Enable workspace support--no-hoist: Disable dependency hoisting in workspaces--no-parallel-workspaces: Disable parallel installation of workspace packages--workspace-concurrency <number>: Number of concurrent workspace installations--workspace-filter <packages...>: Filter specific workspace packages
--cache-compression: Enable cache compression (default: true)--no-cache-compression: Disable cache compression--cache-compression-level <number>: Set compression level (1-9)--cache-compression-format <format>: Set compression format (gzip, brotli)--cache-integrity-check: Enable integrity checking (default: true)--no-cache-integrity-check: Disable integrity checking--memory-limit <percentage>: Set memory usage limit (default: 80%)--no-streaming: Disable streaming operations
--no-network-check: Disable network availability check--network-timeout <ms>: Network check timeout in milliseconds (default: 5000)--network-retries <number>: Number of retries for network operations (default: 2)--no-fallbacks: Disable fallbacks in offline mode--no-outdated-warnings: Disable warnings about outdated dependencies in offline mode
--cloud-cache: Enable cloud cache integration--cloud-provider <provider>: Cloud provider type (s3, azure, gcp)--cloud-region <region>: Cloud provider region--cloud-endpoint <url>: Cloud provider endpoint URL--cloud-bucket <name>: Cloud provider bucket name--cloud-prefix <prefix>: Cloud provider prefix--cloud-sync <policy>: Cloud sync policy (always-upload, always-download, upload-if-missing, download-if-missing, newest)--team-id <id>: Team ID for shared caching--team-token <token>: Team access token--team-access-level <level>: Team access level (read, write, admin)--team-restrict: Restrict access to team members only--invalidate-on-lockfile-change: Invalidate cache when lockfile changes
-f, --format <format>: Snapshot format (zip, tar, tar.gz)-c, --compression <level>: Compression level (0-9)-o, --output <path>: Custom output path for snapshot
-s, --snapshot <path>: Path to snapshot file
-g, --global: Clean global cache instead of project-a, --all: Clean both project and global cache--cache-max-age <days>: Maximum age for cache entries in days
-f, --force: Force sync even if dependencies are up to date--skip-snapshot: Skip creating snapshot after sync--skip-cache: Skip using cache during sync
--verify: Verify cache integrity--optimize: Optimize cache storage
--no-dev: Exclude dev dependencies--direct-only: Show only direct dependencies--max-depth <depth>: Maximum depth to analyze--no-duplicates: Hide duplicate dependencies--no-sizes: Hide dependency sizes--format <format>: Output format (tree, dot, markdown)--output <file>: Output file path--no-versions: Hide dependency versions--no-colors: Disable colors in output
add <path>: Add a plugin from a pathremove <name>: Remove a plugin by namelist: List all installed plugins
- Dependency Resolution: Parses lockfiles to determine exact dependencies
- Workspace Detection: Identifies workspace packages in monorepos (when enabled)
- Cache Check: Checks if dependencies are in the global cache
- Snapshot Check: Checks if a valid
.flashpacksnapshot exists - Memory Optimization: Configures memory limits and batch sizes based on system capabilities
- Installation: If no cache or snapshot is available, installs dependencies using the package manager
- Workspace Installation: Installs workspace packages in dependency order (when enabled)
- Streaming Operations: Uses streaming for file operations to minimize memory footprint
- Caching: Adds newly installed packages to the cache with optional compression
- Integrity Verification: Validates package checksums against npm registry
- Snapshotting: Creates a
.flashpacksnapshot with fingerprinting for future use - Plugin Execution: Runs plugins at various lifecycle hooks
flash-install includes a powerful plugin system that allows extending functionality through lifecycle hooks:
- preInstall: Before installation begins
- postInstall: After installation completes
- preSnapshot: Before creating a snapshot
- postSnapshot: After creating a snapshot
- preRestore: Before restoring from a snapshot
- postRestore: After restoring from a snapshot
- preSync: Before syncing dependencies
- postSync: After syncing dependencies
- preClean: Before cleaning
- postClean: After cleaning
Plugins can be used for tasks like:
- TypeScript declaration generation
- Security scanning
- License compliance checking
- Dependency visualization
- Custom build steps
| Scenario | npm install | flash-install | Speedup |
|---|---|---|---|
| First install (small project) | 30-60s | 10-15s | 3-4x |
| First install (large project) | 3-5min | 1-2min | 2-3x |
| Subsequent install (from cache) | 30-60s | 5-10s | 6-10x |
| Subsequent install (from snapshot) | 30-60s | 1-3s | 20-30x |
| CI/CD environment | 1-3min | 5-15s | 10-20x |
- Time Savings: Dramatically reduces installation time for repeated builds
- Bandwidth Savings: Minimizes network usage by using cached packages
- Disk Space Efficiency: Uses hardlinks and compression to avoid duplicating files
- Memory Efficiency: Optimized for low memory usage even with large dependency trees
- CI/CD Optimization: Perfect for continuous integration environments
- Developer Experience: Instant dependency restoration when switching branches
- Monorepo Efficiency: Optimized workspace handling with dependency hoisting
- Offline Development: Work without internet connection using cache or snapshots
- Streaming Operations: Uses streaming for file operations to minimize memory footprint
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository at https://github.com/Nom-nom-hub/flash-install
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request at https://github.com/Nom-nom-hub/flash-install/pulls
flash-install provides two CLI interfaces:
- Main CLI Interface (
flash-install): The primary interface with all core commands and features. - Direct CLI Interface (
flash-install-direct): A simplified interface with direct implementations of commands.
The direct CLI interface can be accessed by running:
node dist/cli-direct.js <command>This interface is useful for:
- Debugging issues with the main CLI
- Running commands with minimal overhead
- Accessing experimental features not yet available in the main CLI
Note: Some commands may behave slightly differently between the two interfaces. The main CLI interface is recommended for most users.
For more detailed documentation, see the docs directory.
- Performance Optimizations - Learn about the performance optimizations in flash-install
- Monorepo Support - Manage dependencies in monorepos
- Offline Mode - Work without an internet connection
- Dependency Analysis - Analyze and visualize dependencies
- Cloud Cache - Share caches across machines and teams
- Enhanced Plugin System - Extend flash-install with plugins
flash-install is an open-source project that relies on community support. If you find this tool valuable for your work, please consider sponsoring its development.
Your sponsorship helps us:
- Maintain and improve flash-install
- Develop new features
- Provide better documentation
- Support the community
See our SPONSORS.md file for a list of our generous sponsors.
MIT
