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

Package detail

where-is

eu8127313MIT1.0.4

Finds file or directory by traverse the directory tree bottom-up.

whereis, file finder, traverse directory , find the project root

readme

whereis

Finds file or directory by traverse the directory tree bottom-up.

Getting started

var whereIs = require('where-is');

//where-is returns the/path/package.json/exists/
var projectRoot = whereIs('package.json');

//where-is returns false when no file matches
var maybeFalse = whereIs('perhaps-no-exist-file');

Parameters

whereIs(file(or directory)name[, startingPath]);

where-is returns the path where contains given file name/directory name. If given startingPath is /foo/bar/fox/dog then where-is starts searching with following order.

/foo/bar/fox/dog
/foo/bar/fox/
/foo/bar/
/foo/
/

Default startingPath is process.cwd().

install

npm install where-is

license

MIT