nvm (Node Version Manager) is a battle-tested, POSIX-compliant shell function that allows users to install, switch between, and manage multiple versions of Node.js and io.js on a per-shell basis. The core architecture is a single monolithic shell script (`nvm.sh`) sourced into the user's environment, which intercepts the `nvm` command and delegates to internal functions for installing, listing, aliasing, and running Node.js versions. Key entry points include `nvm.sh` (the main script), `install.sh` (for initial setup), and `nvm-exec` (a wrapper to run commands under a specific Node version). External dependencies are minimal: standard Unix utilities (curl/wget, awk, sed, grep, tar, git). Data flows involve fetching version index files from nodejs.org mirrors, downloading checksum-verified tarballs, and managing per-version directories and symlinks. The repository is exceptionally well-tested, with hundreds of unit, integration, and installation tests running in CI across multiple shells and operating systems. Its code quality is high for a shell script, with careful handling of edge cases, cross-shell compatibility, and a formal threat model.
fnm (Fast Node Manager) is a cross-platform Node.js version manager built in Rust. It allows users to install, switch between, and manage multiple Node.js versions on a single system. The application features automatic version switching based on directory via .node-version or .nvmrc files, shell integration for Bash, Zsh, Fish, and PowerShell, version aliasing, and the ability to execute commands with specific Node.js versions. Built with performance and reliability in mind, fnm provides a modern alternative to tools like nvm with faster startup times and more robust shell integration.
NVM for Windows is a Node.js version manager for Windows, providing CLI, shim/link mode, background sync, and Windows-native integrations (Event Log, Registry, Notifications). The repository contains the build system, installer (Inno Setup with extensive Pascal scripting), and a Zig-based elevated migration helper. The actual application logic (CLI, shim, sync) resides in separate submodules (cli, shim, sync, common) not included in this analysis. The visible code demonstrates high craftsmanship: the installer handles complex migration from v1, ACL hardening, silent install policies, and scheduled task management. The Zig updater is a clean, self-contained elevated cleanup tool. The build scripts are well-structured PowerShell with parameterized steps and CI/CD integration. The project is actively maintained with a recent v2 rewrite, modern CI workflows, and a large user base.