sunknudsen
sunknudsen

Reputation: 7230

How can I check if a NPM package name is available?

I used to check if a package name is available by opening https://www.npmjs.com/package/<name>.

That doesn’t work anymore as NPM checks for similar-name conflicts.

Is there a different way?

Upvotes: 13

Views: 8334

Answers (4)

Acid Coder
Acid Coder

Reputation: 2747

you can use this website to generate unused name

https://npmutil.com/

it is my open source project enter image description here

only 7 [consonants] [vowels] [consonants] names left at the time of writing

Upvotes: 1

zerocewl
zerocewl

Reputation: 12774

  1. npm-name

npm-name @ npm / npm-name @ GitHub

Check whether a package or organization name is available on npm

Install:

$ npm install npm-name

Usage:

const npmName = require('npm-name');
 
(async () => {
    // Check a package name
    console.log(await npmName('chalk'));
    //=> false
 
 
    // Check an organization name
    console.log(await npmName('@ava'));
    //=> false 
})();
  1. npm-name-cli

npm-name-cli @ npm / npm-name-cli @ GitHub

Install:

$ npm install --global npm-name-cli

Usage:

$ npm-name --help

  Usage
    $ npm-name <name> …

  Examples
    $ npm-name chalk
    ✖ chalk is unavailable
    $ npm-name abc123
    ⚠ abc123 is squatted
    $ npm-name unicorn-cake
    ✔ unicorn-cake is available
    $ npm-name @ava
    ✖ @ava is unavailable
    $ npm-name @abc123
    ✔ @abc123 is available
    $ npm-name @sindresorhus/is unicorn-cake
    ✖ @sindresorhus/is is unavailable
    ✔ unicorn-cake is available

  Exits with code 0 when all names are available or 2 when any names are taken

Upvotes: 8

Sachin Yadav
Sachin Yadav

Reputation: 806

npm install npm-name

Reference: https://www.npmjs.com/package/npm-name

You could also refer to this: https://docs.npmjs.com/misc/registry

Upvotes: 0

Paul Razvan Berg
Paul Razvan Berg

Reputation: 21348

If you are interested in checking if an organization name is free, use the following URL:

https://npmjs.com/org/ORG_NAME_HERE

If you're getting a "404 Not Found" error, it means the name is free. Otherwise it is not.

Upvotes: 4

Related Questions