node package manager

npm-name

Check whether a package name is available on npm

npm-name

Check whether a package name is available on npm

$ npm install --save npm-name
const npmName = require('npm-name');
 
npmName('chalk').then(available => {
console.log(available);
//=> false 
});
 
npmName.many(['chalk', 'abc123']).then(result => {
console.log(result.get('chalk'));
//=> false 
console.log(result.get('abc123'));
//=> true 
});

Returns a promise for a boolean.

Type: String

Name to check.

Returns a promise for a Map of name/status.

Type: Array

Multiple names to check.

MIT © Sindre Sorhus