Find the closest package.json file meeting specific criteria by searching upwards from a given directory until hitting root.
closest(dir, [filter], found(err, file))
Given a starting directory
dir, look up through every directory to see if
it contains a
package.json file matching the
filter function, for example:
filter is optional and takes the following arguments:
json: the parsed
package.json's absolute filename.
file = closest.sync(dir, [filter])
Same as the
closest function, however executed synchronously:
var result = closestconsole
MIT. See LICENSE.md for details.