npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pnpm-migrator-tui

v1.0.1

Published

TUI tool to migrate multiple Node.js projects to PNPM safely, with parallel jobs and progress tracking.

Downloads

193

Readme

pnpm-migrate

pnpm-migrate is a cross-platform CLI/TUI tool that helps you migrate multiple Node.js projects from npm lockfiles to pnpm safely and quickly.

It keeps the workflow interactive and user-friendly, while adding guardrails for destructive operations.

What It Does

  • Scans a root directory recursively for Node.js projects (package.json).
  • Lets you choose migration options interactively (or via CLI flags).
  • Optionally backs up package files before changes.
  • Optionally deletes node_modules* folders safely.
  • Runs pnpm import when package-lock.json exists.
  • Runs pnpm install --frozen-lockfile=false with retries.
  • Optionally runs pnpm approve-builds --all.
  • Removes package-lock.json after successful migration.
  • Shows real-time progress and prints a final summary.

Features

  • Recursive project discovery.
  • Dry-run mode (--dry-run) for safe previews.
  • Parallel processing (--parallel <N>) for faster migration.
  • Optional node_modules* cleanup with explicit confirmation.
  • Optional backup to a central backup directory.
  • Optional automatic build approval.
  • Retry logic for install failures (up to 2 retries per project).
  • Interactive project selection when many projects are found.
  • Root directory cache for faster repeated runs.
  • Fuzzy root selection (autocomplete) when available, with automatic fallback.
  • Environment checks for Node.js, PNPM, and Corepack.
  • End-of-run trace log for troubleshooting/auditing.

Requirements

  • Node.js >= 20
  • PNPM available in PATH (tool can help bootstrap using Corepack when possible)

Installation

Option 1: Clone and link locally (recommended for development)

git clone https://github.com/ogiboy/pnpm-migrator-tui.git
cd pnpm-migrator-tui
pnpm install
npm link

Then run:

pnpm-migrate

Option 2: Global install

npm install -g pnpm-migrator-tui

CLI Options

pnpm-migrate [options]

| Option | Description | | ----------------------- | --------------------------------------------------------------- | | --dry-run | Preview actions without changing files. | | --parallel <N> | Number of projects to migrate concurrently. | | --delete-node-modules | Delete node_modules* directories before install. | | --backup | Backup package.json and package-lock.json before migration. | | --auto-approve-builds | Run pnpm approve-builds --all after install. | | --root <path> | Set scan root path without root selection prompt. | | -h, --help | Show CLI help. |

If an option is not provided, pnpm-migrate asks interactively.

Step-by-Step Workflow

  1. Start the tool with pnpm-migrate.
  2. Environment check runs:
    • Validates Node.js version.
    • Checks PNPM/Corepack availability.
    • Offers safe install/update actions when needed.
  3. Select root directory:
    • Fuzzy autocomplete is preferred if available.
    • If unavailable or install fails, tool falls back to manual path input.
  4. Choose migration options:
    • Dry-run, parallel jobs, delete node_modules, backup, approve builds.
  5. Confirm destructive action (if cleanup is enabled).
  6. Tool scans for projects recursively under selected root.
  7. If many projects are found, optionally choose a subset from a checkbox list.
  8. Confirm and start migration.
  9. Watch real-time progress bar and per-project results.
  10. Review summary (success, failed, skipped) and trace log path.

Example CLI Session

$ pnpm-migrate

PNPM Migration TUI

Environment Check
Node.js: v22.14.0
PNPM: 10.2.1
Corepack: 0.31.0

Select root directory: ~/Documents/Projects
Dry run? No
Parallel jobs: 4
Delete ALL node_modules* directories? Yes
Auto approve pnpm builds? Yes
Backup package files before migration? Yes
This will delete node_modules* directories from selected projects. Continue? Yes

Scanning Projects
Found 27 project(s)
Show projects to select? Yes
Select projects to migrate: [api-service, web-app, admin-panel]
Start migration? Yes

Progress |████████████████████████████| 100% || 3/3 projects

Migration Summary
Success: 3
Skipped: 0
Failed: 0

Trace log written to ~/.pnpm-migration-last-run.json

Migration Steps Per Project

For each selected project, pnpm-migrate performs:

  1. Optional backup of:
    • package.json
    • package-lock.json
  2. Optional deletion of node_modules* directories.
  3. pnpm import (if package-lock.json exists).
  4. pnpm install --frozen-lockfile=false (with retries).
  5. Optional pnpm approve-builds --all.
  6. Remove package-lock.json after successful migration.

Module Architecture

  • src/envCheck.js
    • Environment checks (Node.js, PNPM, Corepack) and safe bootstrap/update prompts.
  • src/rootSelection.js
    • Root selection prompt, cache loading/saving, fuzzy autocomplete integration, fallback input.
  • src/projectDiscovery.js
    • Recursive discovery of project directories containing package.json.
  • src/migration.js
    • Per-project migration execution, retries, cleanup, backup, and parallel worker orchestration.
  • src/logging.js
    • User-facing logs, progress bar, summaries, and trace-log writing.
  • src/utils.js
    • Shared helpers for path normalization, OS checks, safe deletion, retries, and CLI arg parsing.
  • src/qualityCheck.js
    • Self-quality validation of execution order, path safety, and migration result consistency.
  • pnpm-migration-tui.js
    • Main CLI entrypoint that coordinates the full workflow.

Safety Notes and Best Practices

  • Destructive cleanup is never silent:
    • node_modules* deletion requires explicit user confirmation.
  • Path safety is enforced:
    • Deletion is blocked if target path is outside the selected root.
  • Root validation is strict:
    • Selected root must exist.
  • Fallback behavior is robust:
    • If autocomplete plugin is unavailable or fails to install, manual input prompt is used.
  • Dry-run first for large migrations:
    • Use --dry-run to preview operations before real changes.
  • Keep backups enabled on first run:
    • Strongly recommended when migrating many repositories.

Backup, Cache, and Logs

  • Backup directory:
    • ~/pnpm-migration-backups
  • Root cache file:
    • ~/.pnpm-migration-cache.json
  • Last run trace log:
    • ~/.pnpm-migration-last-run.json

Cross-Platform Notes

  • Supports macOS, Linux, and Windows.
  • Destructive operations are done through Node.js filesystem APIs with root-boundary checks.
  • The tool avoids unsafe shell-dependent deletion behavior.

Troubleshooting

  • No projects found:
    • Verify root path and that target folders contain package.json.
  • PNPM not found:
    • Accept the guided Corepack/npm install prompt, or install PNPM manually.
  • Autocomplete not available:
    • Continue with manual root path input; functionality is unchanged.
  • Permission issues:
    • Re-run in a shell with appropriate permissions for selected project directories.