{%= description %}
{%= include("install-npm", {save: true}) %}
See the benchmarks or unit tests.
var lookup = require('{%= name %}');
lookup('package.json');
//=> '/Users/jonschlinkert/dev/look-up/package.json'
look-up will recurse up from the cwd until it finds the given file.
lookup('package.json', { cwd: 'foo/bar' });
//=> '/Users/jonschlinkert/dev/look-up/package.json'
Glob patterns are also supported (string or array):
lookup(['*.json', '*.foo'], { cwd: 'foo/bar' });
//=> '/Users/jonschlinkert/dev/look-up/package.json'
Benchmarks were run on mac and windows. look-up is 5x-20x faster than [findup-sync][] and 3x faster than [find-up][]
Note that [find-up][] does not support glob patterns, so these benchmarks only include arguments that are supported by all three libs.
As of {%= date() %}:
{%= docs("last", {cwd: "benchmark"}) %}
To run the benchmarks, install dev dependencies:
npm i -d && npm run benchmark
{%= related(verb.related.list) %}
{%= include("tests") %}
As of {%= date() %}:
Statements : 100% (57/57)
Branches : 100% (26/26)
Functions : 100% (5/5)
Lines : 100% (55/55)
{%= include("contributing") %}
{%= include("author") %}
{%= copyright() %} {%= license() %}
{%= include("footer") %}
{%= reflinks(['micromatch', 'findup-sync', 'find-up']) %}