LinuxCommandLibrary

npm-name

Check availability of a given npm package name

TLDR

Check if a specific package name is available in the npm registry

$ npm-name [package]
copy

Find similar package names in the npm registry
$ npm-name --similar [package]
copy

SYNOPSIS

npm-name package_name

PARAMETERS

package_name
    The name you want to check for availability on npm.

DESCRIPTION

The `npm-name` command allows you to quickly check if a given name is available for use as an npm package. It's a command-line tool that simplifies the process of verifying name availability before starting a new npm package. It avoids the need to manually search on npmjs.com or create a dummy package to test the name. The tool queries the npm registry to determine if the name is already taken or if it's available for registration. The command provides a simple output indicating whether the name is available or not.

This command can be particularly useful in scripting or automated workflows, where you need to programmatically check for available package names. For instance, it can be integrated into tools that automatically generate npm package scaffolds. It increases developer efficiency.

CAVEATS

The `npm-name` command relies on the npm registry being accessible. If the npm registry is down or experiencing issues, the command may not function correctly.

The availability check is only a snapshot in time. Another user could register the name between the time you check and the time you try to publish the package.

OUTPUT

The command returns with code 0 when the name is free, and a non-zero code when the name is taken.

INSTALLATION

This command needs to be installed globally with npm. Use: npm install -g npm-name

HISTORY

The `npm-name` command's history isn't explicitly documented in standard Linux manuals, as it is a separate npm package and not part of the core npm CLI. It was developed as a utility to simplify the process of verifying package name availability and has seen usage by developers seeking to automate project setup and name checking workflows.

SEE ALSO

npm(1), npm-publish(1), npm-registry(5)

Copied to clipboard