node package manager

npm-name

npm-name Build Status

Check whether a package name is available on npm

Install

$ npm install --save npm-name

Usage

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 
});

API

npmName(name)

Returns a promise for a boolean.

name

Type: String

Name to check.

npmName.many(names)

Returns a promise for a Map of name/status.

names

Type: Array

Multiple names to check.

Related

License

MIT © Sindre Sorhus