- Introduction
- Installation
- Quick Start Guide
- Configuration
- Commands
- Features
- Error Handling
- Performance Tracking
- Cloud Integration
- Troubleshooting
- Performance Optimization
- API Reference
- FAQ
Flash Install is a fast, drop-in replacement for npm install with deterministic caching. It significantly speeds up package installation times by intelligently caching packages and using parallel downloads.
- Speed: Up to 65x faster than traditional npm install
- Caching: Advanced caching system for faster repeated installations
- Reliability: More stable and reliable dependency management
- Compatibility: Drop-in replacement for existing npm workflows
- Node.js version 16.0.0 or higher
- npm or yarn package manager
npm install -g @flash-install/cliyarn global add @flash-install/cliFlash Install works as a drop-in replacement for npm install:
# Install all dependencies (equivalent to npm install)
flash
# Install a specific package (equivalent to npm install package-name)
flash lodash
# Install as dev dependency (equivalent to npm install package-name --save-dev)
flash lodash --save-devFor optimal performance, run the interactive setup wizard:
flash setupThis will guide you through configuration options including cache directory, concurrency settings, and cloud caching.
Flash Install can be configured via command line flags or a configuration file.
| Option | Description | Default |
|---|---|---|
--offline |
Install from cache only | false |
--no-dev |
Skip devDependencies | false |
--concurrency <number> |
Number of parallel downloads | 8 |
--timeout <ms> |
Request timeout in milliseconds | 30000 |
--verbose |
Enable verbose logging | false |
--quiet |
Suppress output | false |
--cloud-cache |
Enable cloud caching | false |
--cloud-provider <provider> |
Cloud provider (aws, gcp, azure) | aws |
--cloud-bucket <name> |
Cloud bucket name | - |
--workspace <dir> |
Install in workspace | - |
--workspace-filter <pattern> |
Filter for workspaces | - |
Flash Install can also be configured using a .flashrc file in your project directory or a global config file at ~/.flash-install/config.json:
{
"cacheDir": "/path/to/cache",
"concurrency": 8,
"timeout": 30000,
"cloudCache": false,
"cloudProvider": "aws",
"cloudBucket": "your-bucket-name",
"verbose": false
}Install packages with Flash Install (drop-in replacement for npm install)
Usage:
flash [options]Examples:
flash # Install all dependencies
flash lodash # Install a specific package
flash lodash --save-dev # Install as dev dependency
flash --offline # Install from cache only
flash --no-dev # Install production dependencies onlyRun the interactive setup wizard to configure Flash Install
Usage:
flash setupExamples:
flash setup # Run the guided setup processClean the package cache
Usage:
flash clean [options]Examples:
flash clean # Clean the entire cache
flash clean --dry-run # Show what would be cleaned without doing itRun a performance benchmark against npm
Usage:
flash benchmarkExamples:
flash benchmark # Compare Flash Install vs npm install performanceShow the status of Flash Install
Usage:
flash statusExamples:
flash status # Show cache status, network connectivity, etc.Show help information and user guidance
Usage:
flash help [topic]Examples:
flash help # Show general help
flash help issues # Show common issues and solutions
flash help performance # Show performance tips
flash help troubleshooting # Show troubleshooting guideFlash Install implements a multi-layer caching system:
- Package-level caching
- Dependency-tree-level caching
- Integrity verification with SHA256
- Optional compression (gzip/brotli)
- Configurable number of concurrent downloads (default: 8)
- Connection pooling for efficient resource usage
- Rate limiting to respect registry limits
- Intelligent retry mechanism with exponential backoff
Flash Install implements a comprehensive error handling system with detailed categorization and actionable suggestions:
- File System:
FILE_NOT_FOUND,PERMISSION_DENIED,DISK_SPACE,FILE_SYSTEM - Network:
NETWORK_TIMEOUT,NETWORK_CONNECTION,NETWORK_DNS,NETWORK - Cloud:
CLOUD_AUTHENTICATION,CLOUD_PERMISSION,CLOUD_RESOURCE,CLOUD_QUOTA,CLOUD - Package:
PACKAGE_NOT_FOUND,PACKAGE_INVALID,PACKAGE_VERSION,PACKAGE - Configuration:
CONFIG_INVALID,CONFIG_MISSING,CONFIG - Dependency:
DEPENDENCY_CONFLICT,DEPENDENCY_MISSING,DEPENDENCY - Process:
PROCESS_TIMEOUT,PROCESS_CRASH,PROCESS - Memory:
MEMORY_LIMIT,MEMORY_LEAK,MEMORY - Unknown:
UNKNOWN
FAIL: No recovery possible, fail immediatelyRETRY: Retry the operationALTERNATIVE: Use an alternative approachCONTINUE_DEGRADED: Continue with degraded functionalityIGNORE: Ignore the error and continue
The FlashError class provides enhanced error information:
- Detailed error categorization
- Recovery strategy suggestions
- Actionable guidance for users
- Contextual information for debugging
When errors occur, Flash Install automatically provides actionable suggestions such as:
- Checking file/directory permissions
- Verifying network connectivity
- Increasing timeout values
- Running the setup wizard to review configuration
Flash Install includes a comprehensive PerformanceTracker for monitoring and analyzing installation performance:
- Installation time
- Package count
- Cache hit rate
- Network operations count and time
- Cache operations count and time
- CPU usage
- Memory usage (current and peak)
- Success/failure rates
trackInstallation(): Records an installation event with all metricsstartOperation(): Begin tracking a specific operationendOperation(): End tracking and get durationgetStats(): Retrieve current performance statisticsgetMetrics(): Retrieve collected performance metricsgetAverageInstallationTime(): Calculate average installation timegetSuccessRate(): Calculate success rate percentageexportReport(): Export performance report in JSON or CSV formatreset(): Clear all collected metrics
flash benchmark: Compare Flash Install vs npm install performanceflash status: Show cache status, network connectivity, and performance metrics
Flash Install supports cloud integration through cloud-based caching for team environments:
- AWS S3: Amazon S3 buckets for cache synchronization
- Google Cloud Storage: GCP Cloud Storage for shared caching
- Azure Blob Storage: Microsoft Azure Blob Storage support
Cloud caching can be configured via:
- Command line:
--cloud-cache --cloud-provider <provider> --cloud-bucket <name> - Configuration file: Set
cloudCache,cloudProvider, andcloudBucketoptions
- Shared cache across team members
- Consistent installation times
- Reduced bandwidth usage
- Faster CI/CD pipelines
Flash Install is built with several core components that work together to provide high performance:
The NetworkManager handles all network operations and connectivity checks. It includes features like:
- DNS resolution checking
- Registry availability verification
- Internet connectivity validation
- Network status monitoring
The ParallelDownloadManager implements efficient parallel downloads with:
- Configurable concurrency levels
- Connection pooling
- Retry logic with exponential backoff
- Progress tracking
- Queue-based processing
The WorkerPool manages parallel processing tasks with:
- Adaptive batch sizing based on memory usage
- Automatic garbage collection
- Task timeout protection
- Memory monitoring and throttling
The Timer utility provides precise performance measurement with:
- High-resolution timing (nanosecond precision)
- Start/stop/reset functionality
- Elapsed time formatting
Cause: Insufficient permissions to write to node_modules or cache directory
Solution: Run with appropriate permissions (e.g., use sudo on Unix systems), or change the cache directory location in configuration.
Cause: Suboptimal configuration or network conditions
Solution: Use the setup wizard to optimize settings like concurrency and timeout, or try installing during off-peak network hours.
Cause: Request taking longer than configured timeout
Solution: Increase the timeout value in your configuration, or reduce concurrency to decrease network load.
Cause: Cache directory issues or corrupted cache entries
Solution: Clean the cache with flash clean and reinstall, or verify cache directory permissions and space.
Cause: Dependency not properly linked or cached
Solution: Try running flash again, or clear the cache and reinstall. Verify the package name is correct.
- Verify Installation: Run
flash --versionto confirm Flash Install is properly installed - Check Network: Ensure your internet connection is working and firewall/proxy settings are correct
- Verify Cache: Use
flash statusto check cache status and runflash cleanif needed - Validate Configuration: Run the setup wizard with
flash setupto review and optimize settings - Test with Simple Package: Try installing a simple package like
lodashto isolate the issue - Check Logs: Enable verbose logging with
--verboseflag to gather more information
- Optimize Concurrency: Adjust the number of concurrent downloads based on your system and network. Start with 8 and adjust as needed.
- Use Cache Effectively: Flash Install uses a smart caching system. The first installation of a package will be slower, but subsequent installations will be extremely fast.
- Configure Network Settings: Set appropriate timeout values and consider using cloud caching for team environments.
- Offline Mode: Use
--offlineflag to install from cache only when network connectivity is limited. - Production Installs: Use
--no-devflag to skip devDependencies for faster production builds.
Use the built-in benchmark command to compare Flash Install with npm:
flash benchmarkThis will compare installation times for different project sizes and provide detailed performance metrics.
Flash Install provides both command-line and programmatic APIs.
import { PackageDownloader } from './utils/parallel-downloader.js';
import { PerformanceTracker } from './utils/performance-tracker.js';
import { ErrorHandler } from './utils/error-handler.js';
// Example: Use the package downloader programmatically
const downloader = new PackageDownloader({
concurrency: 8,
timeout: 30000
});
try {
const result = await downloader.downloadPackage(
'lodash',
'4.17.21',
'./downloads'
);
console.log('Download successful:', result);
} catch (error) {
console.error('Download failed:', error.message);
}
// Example: Track performance
const tracker = new PerformanceTracker();
tracker.startOperation('installation');
// ... perform installation ...
const duration = tracker.endOperation('installation');
console.log(`Installation took ${duration}ms`);Flash Install typically achieves 40-65x speed improvements over npm install, with the exact improvement depending on project size and network conditions.
Yes, Flash Install is designed as a drop-in replacement for npm install, supporting all common flags and workflows.
Flash Install is primarily designed as an npm replacement, but it can be configured to work in projects using other package managers.
Flash Install caches packages at multiple levels - individual packages and dependency trees. It uses SHA256 integrity verification to ensure cache reliability.
Yes, cloud caching uses secure authentication with your cloud provider and maintains the same integrity checks as local caching.
Flash Install supports all platforms where Node.js runs, including Windows, macOS, and Linux.