How schniz/fnm works
fnm is a cross-platform Node.js version manager. Users invoke its CLI to install versions from Node distributions, select versions directly or from .node-version/.nvmrc files, and expose the selected installation through shell initialization; commands also manage aliases, defaults, listings, and removal. The graph separates command workflows, version resolution, installation/storage, and shell integration. Edges are limited to relationships visible in excerpts, the source index, or README; several unsampled command implementations are represented at their exact directory paths.
Main entry points: install.rs Install version · use.rs Select version · user_version_reader.rs Input reader · version_files.rs Version file lookup
Components 22
CLI commands
- CLI dispatch
src/cli.rs - Command interface
src/commands/command.rs - Select version
src/commands/use.rs - Run with version
src/commands/exec.rs - Install version
src/commands/install.rs - Other commands
src/commands
Version resolution
- Configuration
src/config.rs - Version model
src/version.rs - Version input
src/user_version.rs - Input reader
src/user_version_reader.rs - Version file lookup
src/version_files.rs - Version selection
src/choose_version_for_user_input.rs
Install and storage
- Remote version index
src/remote_node_index.rs - Node downloader
src/downloader.rs - Archive extraction
src/archive/mod.rs - HTTP client
src/http.rs - Installed versions
src/installed_versions.rs - Alias storage
src/alias.rs - Filesystem operations
src/fs.rs
Shell integration
- Shell environment
src/commands/env.rs - Shell adapters
src/shell
Other components
- Terminal user
Connections 22
- Terminal user → CLI dispatch: invokes
- CLI dispatch → Command interface: dispatches
- Select version → Input reader: reads input
src/commands/use.rs - Select version → Version file lookup: resolves files
src/commands/use.rs - Select version → Installed versions: checks versions
src/commands/use.rs - Select version → Install version: installs missing
src/commands/use.rs - Run with version → Version selection: selects version
src/commands/exec.rs - Run with version → Input reader: reads input
src/commands/exec.rs - Install version → Version file lookup: resolves directory
src/commands/install.rs - Install version → Remote version index: lists releases
src/commands/install.rs - Install version → Node downloader: installs distribution
src/commands/install.rs - Install version → Alias storage: creates aliases
src/commands/install.rs - Node downloader → HTTP client: downloads archive
src/downloader.rs - Node downloader → Archive extraction: extracts archive
src/downloader.rs - Remote version index → HTTP client: fetches index
src/remote_node_index.rs - Input reader → Version file lookup: reads files
src/user_version_reader.rs - Input reader → Version input: parses version
src/user_version_reader.rs - Version file lookup → Version input: parses contents
src/version_files.rs - Version selection → Version input: matches input
src/choose_version_for_user_input.rs - Version selection → Installed versions: checks installed
src/choose_version_for_user_input.rs - Shell environment → Shell adapters: renders environment
src/commands/env.rs - Terminal user → Shell environment: requests setup