nm-exists

0.1.0 • Public • Published

nm-exists Build Status

Check if the node module has exists

Install

$ npm install --save nm-exists

Usage

const nmExists = require('nm-exists');
 
// async
nmExists('fs').then(exists => {
    console.log(exists);
    //=> 'true'
});
 
// imagine `express` has been installed in `node_modules/express` directorie
nmExists('express').then(exists => {
    console.log(exists);
    //=> 'true'
});
 
// sync
nmExists.sync('path');
//=> 'true'
 
nmExists.sync('./unicorn');
//=> 'true'

API

nmExists(moduleID)

Returns a promise for a boolean of whether the module exists

nmExists.sync(moduleID)

Returns a boolean of whether the module exists

moduleID

Type: string

License

MIT © Guntur Poetra

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    4

Package Sidebar

Install

npm i nm-exists

Weekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • guntur