Introduction to Fast Node Manager (fnm)
Fast Node Manager, commonly referred to as fnm
, is a tool designed to simplify the management of Node.js versions across different operating systems. Engineered with speed in mind, fnm is lightweight and efficient, offering a seamless experience for developers who work with Node.js frequently. The tool is created using Rust programming language, known for its performance and safety features.
Key Features
-
Cross-platform Support: fnm is compatible with macOS, Windows, and Linux, making it universally accessible to developers using any of these systems.
-
Ease of Use: It requires a single file for installation and provides an instant startup, allowing users to get started quickly without complex setup procedures.
-
Speed: With a focus on performance, fnm is built to provide fast operations, minimizing delays and interruptions in a developer's workflow.
-
Compatibility with Version Files: fnm works seamlessly with
.node-version
and.nvmrc
files, ensuring it integrates well with existing Node.js setup practices.
Installation
Automated Script (macOS/Linux)
For shells like bash
, zsh
, and fish
, fnm offers an automated installation script. Before running the script, ensure curl
and unzip
are installed on your system. The installation command is:
curl -fsSL https://fnm.vercel.app/install | bash
Upgrade
On macOS, users can upgrade fnm using Homebrew with the command brew upgrade fnm
. Other operating systems require a similar process as installation, with an option to skip modifying the shell configuration using --skip-shell
.
Parameters
Users have several options to customize their installation:
--install-dir
: Allows specifying a custom installation directory.--skip-shell
: Prevents automatic modifications to shell configuration files.--force-install
: Forces the use of the installation script on macOS, despite deprecation in favor of Homebrew.
Manual Installation
Using Package Managers
-
Homebrew (macOS/Linux):
brew install fnm
-
Winget (Windows):
winget install Schniz.fnm
-
Scoop (Windows):
scoop install fnm
-
Chocolatey (Windows):
choco install fnm
-
Cargo (Linux/macOS/Windows):
cargo install fnm
Using Release Binary
Download the latest release binary suitable for your operating system from fnm releases. Make it globally accessible by adding it to the PATH
environment variable.
Removal
To uninstall fnm, simply delete the .fnm
folder in the home directory and remove any references in your shell configuration.
Completions
fnm offers shell completions, which can be set up using the command:
fnm completions --shell <SHELL_NAME>
Supported shells include bash, zsh, fish, and PowerShell.
Shell Setup
To use fnm, users must set up specific environment variables by evaluating the output from fnm env
. This setup is necessary for fnm to function correctly on various shells like Bash, Zsh, Fish, and PowerShell.
Configuration and Usage
The tool provides detailed configuration and usage instructions to offer users additional flexibility and functionalities, like automatic version switching.
Contributing
Contributions to the fnm project are welcomed. Developers can start by cloning the repository, building the project using Rust, and running tests to ensure functionality.
# Clone the repository and build
git clone https://github.com/Schniz/fnm.git
cd fnm/
cargo build
# Run the binary
cargo run -- --help
# Run tests
cargo test
In summary, Fast Node Manager is a robust solution for managing Node.js versions, emphasizing speed, simplicity, and compatibility across major operating systems. Its streamlined installation and configuration process make it an excellent choice for developers in need of a fast and reliable Node.js version manager.