5.0.0 • Published 4 years ago

findup-sync v5.0.0

Weekly downloads
8,403,221
License
MIT
Repository
github
Last release
4 years ago

findup-sync

NPM version Downloads Build Status Coveralls Status

Find the first file matching a given pattern in the current directory or the nearest ancestor directory.

Matching is done with micromatch, please report any matching related issues on that repository.

Usage

var findup = require('findup-sync');
findup(patternOrPatterns [, micromatchOptions]);

// Start looking in the CWD.
var filepath1 = findup('{a,b}*.txt');

// Start looking somewhere else, and ignore case (probably a good idea).
var filepath2 = findup('{a,b}*.txt', {cwd: '/some/path', nocase: true});

API

findup(patterns, [options])

  • patterns {String|Array}: Glob pattern(s) or file path(s) to match against.
  • options {Object}: Options to pass to micromatch. Note that if you want to start in a different directory than the current working directory, specify a cwd property here.
  • returns {String}: Returns the first matching file.

License

MIT

5.0.0

4 years ago

4.0.0

6 years ago

3.0.0

7 years ago

2.0.0

8 years ago

1.0.0

9 years ago

0.4.3

9 years ago

0.4.2

9 years ago

0.4.1

9 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.3

12 years ago

0.1.2

13 years ago

0.1.1

13 years ago

0.1.0

13 years ago