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

MIT © Sindre Sorhus