|
12 years ago | |
---|---|---|
.. | ||
lib | 12 years ago | |
test | 12 years ago | |
.jshintrc | 12 years ago | |
.npmignore | 12 years ago | |
Gruntfile.js | 12 years ago | |
LICENSE-MIT | 12 years ago | |
README.md | 12 years ago | |
package.json | 12 years ago |
Find the first file matching a given pattern in the current directory or the nearest ancestor directory.
Install the module with: npm install findup-sync
var findup = require('findup-sync');
// 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(patternOrPatterns [, minimatchOptions])
Type: String
or Array
Default: none
One or more wildcard glob patterns. Or just filenames.
Type: Object
Default: {}
Options to be passed to minimatch.
Note that if you want to start in a different directory than the current working directory, specify a cwd
property here.