npm

Need private packages and team management tools?Check out npm Orgs. »

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.

install

npm i is-npm-module

Downloadsweekly downloads

3

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability