jack e1a2621c78 update | 2 éve | |
---|---|---|
.. | ||
lib | 2 éve | |
test | 2 éve | |
.jshintrc | 2 éve | |
.npmignore | 2 éve | |
.travis.yml | 2 éve | |
Gruntfile.js | 2 éve | |
LICENSE-MIT | 2 éve | |
README.md | 2 éve | |
package.json | 2 éve |
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.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
2014-03-14 - v0.1.3 - Updated dependencies.
2013-03-08 - v0.1.2 - Updated dependencies. Fixed a Node 0.9.x bug. Updated unit tests to work cross-platform.
2012-11-15 - v0.1.1 - Now works without an options object.
2012-11-01 - v0.1.0 - Initial release.