module-exists

v0.4.0
Check if a node module or file exists or not
core modules

module exists

Simply easy: Checks if a node module or file exists or not

Installation

npm install module-exists --save

Basic Usage

var module_exists = require('module-exists');
if (module_exists('nodeunit')) {
   ...
}
if (module_exists('./lib/helper.js')) {
   var helper = require('./lib/helper.js');
}

Run tests

npm install -g nodeunit
npm test

Inspired by Francois-Guillaume Ribreau Contributors: Tushar Mathur (typescript)

npm i module-exists

Metadata

  • MIT
  • Whatever
  • Tobias Oberrauch
  • released 6/23/2020

Downloads

Maintainers