is-npm-module
v1.0.0
Published
test whether a string is a public npm module
Downloads
9
Maintainers
Readme
is-npm-module
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
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.