Check if a directory exists - synchronously or asynchronously
$ npm install --save directory-exists
const directoryExists = require('directory-exists');
directoryExists(directory, callback(error, result) {
// result is a boolean
};const directoryExists = require('directory-exists');
directoryExists.sync(directory); // retuns a booleanBecause asynchronous fs.exists is deprecated. Synchronous fs.existsSync is still fine to use, but this library does both, sync and async.
MIT © timmydoza