module-resolves

1.0.0 • Public • Published

module resolves

Checks to see if a node module (or custom module) exists -- WITHOUT requiring it. If it exists, it will return true, if not, return false. Similar modules will go ahead and require it if it exists, but this one does not. It's been helpful for me! Perhaps you can get some use out of it also :)

Installation

npm install module-resolves --save

Basic Usage

var module_resolves = require('module-resolves');
 
if (module_resolves('./your-directory/yourModule.js')) {
   var yourModule = require('./your-directory/yourModule.js');
}

Inspired by Tobias Oberrauch

Readme

Keywords

Package Sidebar

Install

npm i module-resolves

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • compoundf