index.js
function findPath(path, directories) {
  var cwd = directories[0];

  if (!cwd) {
    return null;
  }

  return findup(path, {cwd: cwd}) || findPath(path, slice.call(directories, 1));
}
function findPath(path, directories) {
  var cwd = directories[0];

  if (!cwd) {
    return null;
  }

  return findup(path, {cwd: cwd}) || findPath(path, slice.call(directories, 1));
}
function findPath ( path , directories ) { var cwd = directories [ 0 ] ; if ( ! cwd ) { return null ; } return findup ( path , { cwd : cwd } ) || findPath ( path , slice . call ( directories , 1 ) ) ; }
Find the requested path inside a list of candidate directories.

@param  {String} path        Path to locate.
@param  {Array}  directories Array of directories.
@return {String}             Located path, or null if not found.
Find the requested path inside a list of candidate directories .