Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@justinc/dir-exists

justin-calleja6.8kISC2.1.0

Checks if a directory exists or not

directory, exists, fs, isDirectory, is-directory

readme

NPM

var dirExists = require('@justinc/dir-exists').dirExists;
var dirExistsSync = require('@justinc/dir-exists').dirExistsSync;
var dirExistsAsPromised = require('@justinc/dir-exists').dirExistsAsPromised;

console.log('sync:', dirExistsSync('/some/path/to/dir'));
console.log(dirExists('/some/path/to/dir', (err, exists) => {
  if (err) throw err;
  console.log('async:', exists);
}));
dirExistsAsPromised('/some/path/to/dir').then(exists => console.log('promise:', exists));