2.0.1 • Published 9 years ago
it-exists v2.0.1
it-exists
Check if a file/folder/module exists with node.js
Installation
$ npm install --save it-exists
Usage
var itExists = require('it-exists');
var myModule = itExists('module-name');
if (myModule)
myModule('do magic!');
var myModule = itExists('module-name', true);
myModule('do magic!');
if (!itExists.pathSync('./tmp'))
require('fs').mkdirSync('./tmp');
itExists.pathAsync('./tmp').then(itExists => {
// handle promise...
});