src/lib/fs.js
function handle(options, callback) {
  if (_.isString(options)) {
    options = { path: options };
  }

  if (_.isObject(options)) {
    const opts = { };
    _.merge(opts, config, options);
    options = opts;
  } else {
    options = _.cloneDeep(config);
  }

  options.path = options.path || config.get("home");
  return stat(options.path, function(err, stats) {
    if (err) {
      return callback(err);
    }

    const done = wrap(stats, callback);

    if (stats.isDirectory()) {
      options.dirStats = stats;
      return processDir(options, done);
    } else if (stats.isFile()) {
      return processFile(options, done);
    }

    return callback(null, null);
  });
}
function handle(options, callback) {
  if (_.isString(options)) {
    options = { path: options };
  }

  if (_.isObject(options)) {
    const opts = { };
    _.merge(opts, config, options);
    options = opts;
  } else {
    options = _.cloneDeep(config);
  }

  options.path = options.path || config.get("home");
  return stat(options.path, function(err, stats) {
    if (err) {
      return callback(err);
    }

    const done = wrap(stats, callback);

    if (stats.isDirectory()) {
      options.dirStats = stats;
      return processDir(options, done);
    } else if (stats.isFile()) {
      return processFile(options, done);
    }

    return callback(null, null);
  });
}
function handle ( options , callback ) { if ( _ . isString ( options ) ) { options = { path : options } ; } if ( _ . isObject ( options ) ) { const opts = { } ; _ . merge ( opts , config , options ) ; options = opts ; } else { options = _ . cloneDeep ( config ) ; } options . path = options . path || config . get ( "home" ) ; return stat ( options . path , function ( err , stats ) { if ( err ) { return callback ( err ) ; } const done = wrap ( stats , callback ) ; if ( stats . isDirectory ( ) ) { options . dirStats = stats ; return processDir ( options , done ) ; } else if ( stats . isFile ( ) ) { return processFile ( options , done ) ; } return callback ( null , null ) ; } ) ; }
Handling requests for browsing file-system

@param {Object|String} options
@param {Function} callback
Handling requests for browsing file - system