Jay Salvat 6094fb6202 New project structure 12 years ago
..
lib 6094fb6202 New project structure 12 years ago
test 6094fb6202 New project structure 12 years ago
.jshintrc 6094fb6202 New project structure 12 years ago
.npmignore 6094fb6202 New project structure 12 years ago
Gruntfile.js 6094fb6202 New project structure 12 years ago
LICENSE-MIT 6094fb6202 New project structure 12 years ago
README.md 6094fb6202 New project structure 12 years ago
package.json 6094fb6202 New project structure 12 years ago

README.md

findup-sync

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

Getting Started

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});

Usage

findup(patternOrPatterns [, minimatchOptions])

patternOrPatterns

Type: String or Array
Default: none

One or more wildcard glob patterns. Or just filenames.

minimatchOptions

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.