Skip to content
This repository has been archived by the owner on Dec 7, 2017. It is now read-only.

Latest commit

 

History

History
82 lines (54 loc) · 1.62 KB

.verb.md

File metadata and controls

82 lines (54 loc) · 1.62 KB

{%= name %} {%= badge("fury") %} {%= badge("travis") %}

{%= description %}

Install

{%= include("install-npm", {save: true}) %}

See the benchmarks or unit tests.

Usage

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'

Running benchmarks

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

{%= related(verb.related.list) %}

Running tests

{%= include("tests") %}

Coverage

As of {%= date() %}:

Statements : 100% (57/57)
Branches   : 100% (26/26)
Functions  : 100% (5/5)
Lines      : 100% (55/55)

Contributing

{%= include("contributing") %}

Author

{%= include("author") %}

License

{%= copyright() %} {%= license() %}


{%= include("footer") %}

{%= reflinks(['micromatch', 'findup-sync', 'find-up']) %}