LinuxCommandLibrary

nrm

Manage and switch between npm registries

TLDR

List all registries

$ nrm ls
copy

Change to a particular registry
$ nrm use [registry]
copy

Show the response time for all registries
$ nrm test
copy

Add a custom registry
$ nrm add [registry] [url]
copy

Delete a registry
$ nrm del [registry]
copy

SYNOPSIS

nrm [command] [options]

PARAMETERS

ls
    Lists all available npm registries.

current
    Shows the currently used npm registry.

use
    Switches the active npm registry to the specified registry name.

add
    Adds a new custom npm registry with a name and URL.

del
    Deletes a custom npm registry.

test
    Tests the response time of a specified registry. If no registry parameter is provided, it tests all registries.

home
    Opens the homepage of the specified registry in the default web browser.

-V, --version
    Displays nrm version.

DESCRIPTION

The nrm command is a Node.js package that allows you to easily switch between different npm registries. It simplifies managing multiple registries, such as the official npm registry, a private registry, or a mirror registry, especially useful when developing across different environments or for organizations with specific registry requirements. nrm provides a straightforward command-line interface to list available registries, add new ones, switch between them, and test their latency.

nrm improves workflow efficiency by eliminating the need to manually configure the npm registry using commands like npm config set registry repeatedly. Using nrm, developers can quickly change the active registry based on the current project or development context, ensuring the proper packages are fetched from the intended source. It enhances developer productivity and simplifies package management in diverse npm environments.

CAVEATS

nrm only manages the registry configuration for the current user. It does not modify the global npm configuration unless explicitly told to. Also, remember to install nrm globally using npm install -g nrm.

INSTALLATION

To install nrm, use the following npm command: npm install -g nrm. This will install nrm globally, making it available from the command line.

CONFIGURATION

nrm stores the registry configurations in a simple JSON format. This file is typically located in the user's home directory. While you can manually edit this file, it is highly recommended to use the nrm add and nrm del commands to manage the registries.

SEE ALSO

npm(1), npm-config(1)

Copied to clipboard