code: function isDirectory(filePath, callback) {
    try {
      fs.stat(filePath, function (err, data) {
        if (err) {
          callback(null, false);
        } else {
          callback(null, data.isDirectory());
        }
      });
    } catch (e) {
      callback(null, false);
    }
  }
docs: /*
  @function isDirectory (private) [Check if a path is directory or file]
  @param filePath {string}
  @param callback