![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | LICENSE | 6 years ago | 1.2K | 7375cab EXHIBTION: fix overflow ellipsis cutoff [كارل مبارك] |
![]() | README.md | 6 years ago | 2.1K | f12eb36 documentaiton updates [كارل مبارك] |
![]() | index.js | 6 years ago | 2.0K | |
![]() | package.json | 2 years ago | 2.5K | 7375cab EXHIBTION: fix overflow ellipsis cutoff [كارل مبارك] |
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.
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});
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.MIT