npm.io
1.0.0 • Published 10 years ago

find-shallow-file

Licence
ISC
Version
1.0.0
Deps
1
Vulns
0
Weekly
0

find-shallow-file

Finds a matching file as shallowly as possile in a given directory.

usage

Search for index.* in someDirectory, searching up to 10 directories deep.

findShallowestFile('someDirectory', /index\..*?/, {maxDepth: 10}, function(error, result){

    // cant error.

    // result will be either null or a path to the shallowest file that matched the regex.

});

See the tests for more examples.