look-up
Like findup-sync and supports the same features but 20x-40x faster on avg.
Install with npm
npm i look-up --save
See the benchmarks or tests.
Usage
var lookup = require('look-up');
lookup(pattern, {cwd: cwd, ...});
pattern
{String|Array}: glob pattern for the file to findoptions
{Object}: options to pass to minimatch
cwd
{String}: the directory to start looking (upwards) from
Examples:
lookup('**/c/package.json', { cwd: 'fixtures/a/b/c/d/e/f/g' });
Pass options to minimatch
lookup('one.txt', { cwd: 'fixtures/a/b/c/d/e/f/g', matchBase: true });
Running benchmarks
node benchmark
Benchmarks were run on mac and windows. look-up is 20-50x faster than findup-sync on avg.
Running tests
Install dev dependencies:
npm install -d && npm test
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Author
Jon Schlinkert
License
Copyright (c) 2014 Jon Schlinkert
Released under the MIT license
This file was generated by verb on December 18, 2014.