is-npm-module

1.0.0 • Public • Published

is-npm-module

experimental

Test whether the given name is a public npm module.

var isModule = require('is-npm-module')
 
isModule('object-assign', function(err, exists) {
  if (err) {
    console.error("Could not connect to database")
    return
  }
  
  console.log(exists) // -> true
})

Builtins like "url" will not query the database.

Usage

NPM

isModule(name, cb)

Tests whether name exists in the public npm database. The callback is provided with (err, exists) parameters; where err is an Error if there was a problem connecting to the database, otherwise exists is a boolean for whether the module was found in the database.

License

MIT, see LICENSE.md for details.

Package Sidebar

Install

npm i is-npm-module

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • mattdesl