Check if a package or organization name is available on the npm registry.
npm-name is a Node.js library that checks whether a given package name or organization name is available for use on the npm registry. It helps developers validate name availability before attempting to publish, reducing errors and saving time. The tool also validates against npm's naming rules and detects names blocked due to punctuation similarities with existing packages.
Node.js and JavaScript developers who publish packages to npm, especially those building tools, CLIs, or workflows that involve automated package creation or name validation.
Developers choose npm-name for its simplicity, accuracy in detecting unavailable names, and batch-checking capability, which integrates seamlessly into automated publishing pipelines. It's a trusted utility from a well-known open-source maintainer, offering reliability where manual checks or web interfaces fall short.
Check whether a package or organization name is available on npm
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers a straightforward promise-based API that returns a boolean for availability, making integration easy, as shown in the basic usage example with `npmName('chalk')`.
Supports checking multiple names at once with `npmNameMany`, returning a map for efficient validation of several candidates, as demonstrated in the README code snippet.
Validates against npm's naming rules (e.g., no underscores or capitals) and detects punctuation-based conflicts like 'ch-alk' vs 'chalk', providing descriptive error messages.
Allows specifying a custom registry URL with the `registryUrl` option, enabling checks against private or alternative npm registries, though it's noted as rarely needed.
Cannot account for npm's server-side similarity checks, which may still reject names at publish time even if reported available, as admitted in the 'Known limitations' section.
Only works with the npm registry, making it unsuitable for projects involving other package managers like PyPI or internal registries without significant modification.
Checks availability at a point in time, so names could be registered by others between the check and actual publication, leading to conflicts despite validation.