lib/impl/importForms/index.js
function checkWorkingDir(workingDir, cb) {
  fs.stat(workingDir, function(err, stats) {
    var errMessage;
    if (err) {
      errMessage = "The directory " + workingDir + " does not exist.";
      logger.error(errMessage);
      return cb(errMessage);
    }

    //Checking that it is a directory
    if (!stats.isDirectory()) {
      errMessage = "Expected " + workingDir + " to be a directory";
      logger.error(errMessage);
      return cb(errMessage);
    }

    return cb();
  });
}
function checkWorkingDir(workingDir, cb) {
  fs.stat(workingDir, function(err, stats) {
    var errMessage;
    if (err) {
      errMessage = "The directory " + workingDir + " does not exist.";
      logger.error(errMessage);
      return cb(errMessage);
    }

    //Checking that it is a directory
    if (!stats.isDirectory()) {
      errMessage = "Expected " + workingDir + " to be a directory";
      logger.error(errMessage);
      return cb(errMessage);
    }

    return cb();
  });
}
function checkWorkingDir ( workingDir , cb ) { fs . stat ( workingDir , function ( err , stats ) { var errMessage ; if ( err ) { errMessage = "The directory " + workingDir + " does not exist." ; logger . error ( errMessage ) ; return cb ( errMessage ) ; } //Checking that it is a directory if ( ! stats . isDirectory ( ) ) { errMessage = "Expected " + workingDir + " to be a directory" ; logger . error ( errMessage ) ; return cb ( errMessage ) ; } return cb ( ) ; } ) ; }
checkWorkingDir - Checking that the working directory exists and is a directory.

@param  {string} workingDir Path to the working directory
@param  {function} cb
checkWorkingDir - Checking that the working directory exists and is a directory .