New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

flash-install

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

flash-install

A fast, drop-in replacement for npm install with deterministic caching

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

flash-install logo

⚡ flash-install

Blazingly fast package installation for Node.js

License: MIT Node.js Version npm version PRs Welcome

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.

Features

  • 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 .flashpack archives for instant dependency restoration
  • Package Manager Compatibility: Works with npm, yarn, and pnpm projects
  • Offline Mode: Install dependencies without internet connection using cache or snapshots
  • 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
  • Plugin System: Extensible architecture with lifecycle hooks

Installation

npm install -g flash-install

Usage

Basic Installation

Replace your regular npm install command with flash-install:

flash-install

Creating a Snapshot

Create a .flashpack snapshot of your node_modules directory:

flash-install snapshot

Restoring from a Snapshot

Restore your node_modules from a .flashpack snapshot:

flash-install restore

Cleaning

Remove node_modules and local .flashpack file:

flash-install clean

Clean the global cache:

flash-install clean --global

Sync Dependencies

Efficiently update dependencies without a full reinstall:

flash-install sync

Cache Information

View information about the global cache:

flash-install cache

Verify cache integrity:

flash-install cache --verify

Optimize cache storage:

flash-install cache --optimize

Plugin Management

List installed plugins:

flash-install plugin list

Add a plugin:

flash-install plugin add <path-to-plugin>

Remove a plugin:

flash-install plugin remove <plugin-name>

Options

Installation Options

  • -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

Snapshot Options

  • -f, --format <format>: Snapshot format (zip, tar, tar.gz)
  • -c, --compression <level>: Compression level (0-9)
  • -o, --output <path>: Custom output path for snapshot

Restore Options

  • -s, --snapshot <path>: Path to snapshot file

Clean Options

  • -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

Sync Options

  • -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

Cache Options

  • --verify: Verify cache integrity
  • --optimize: Optimize cache storage

Plugin Options

  • add <path>: Add a plugin from a path
  • remove <name>: Remove a plugin by name
  • list: List all installed plugins

How It Works

  • Dependency Resolution: Parses lockfiles to determine exact dependencies
  • Cache Check: Checks if dependencies are in the global cache
  • Snapshot Check: Checks if a valid .flashpack snapshot exists
  • Installation: If no cache or snapshot is available, installs dependencies using the package manager
  • Caching: Adds newly installed packages to the cache
  • Integrity Verification: Validates package checksums against npm registry
  • Snapshotting: Creates a .flashpack snapshot with fingerprinting for future use
  • Plugin Execution: Runs plugins at various lifecycle hooks

Plugin System

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

Performance Comparison

Scenarionpm installflash-installSpeedup
First install (small project)30-60s10-15s3-4x
First install (large project)3-5min1-2min2-3x
Subsequent install (from cache)30-60s5-10s6-10x
Subsequent install (from snapshot)30-60s1-3s20-30x
CI/CD environment1-3min5-15s10-20x

Benefits

  • Time Savings: Dramatically reduces installation time for repeated builds
  • Bandwidth Savings: Minimizes network usage by using cached packages
  • Disk Space Efficiency: Uses hardlinks to avoid duplicating files
  • CI/CD Optimization: Perfect for continuous integration environments
  • Developer Experience: Instant dependency restoration when switching branches
  • Offline Development: Work without internet connection using cache or snapshots

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  • Fork the repository
  • 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

Publishing

To publish a new version of flash-install to npm:

Method 1: Using the npm script

  • Update the version in package.json
  • Login to npm: npm login
  • Run the publish script: npm run publish-package

Method 2: Manual publishing

  • Update the version in package.json
  • Build the project: npm run build
  • Login to npm: npm login
  • Publish the package: npm publish

License

MIT

Acknowledgements

  • Inspired by the speed of Bun, the reliability of Yarn, and the efficiency of PNPM
  • Thanks to all the open-source projects that made this possible

Keywords

npm

FAQs

Package last updated on 24 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts