1.0.2 • Published 8 years ago

finddown-sync v1.0.2

Weekly downloads
30
License
MIT
Repository
github
Last release
8 years ago

finddown-sync npm version Build Status

Find all files matching a given pattern in the current directory or child directories. The sibling and opposite function to findup-sync.

Matching is done with micromatch, please report any matching related issues on that repository.

Install with npm

$ npm install --save finddown-sync

Usage

var findDown = require('finddown-sync');
findDown(patternOrPatterns [, micromatchOptions]);

// Start looking in the CWD.
var filepath1 = findDown('{a,b}*.txt');

// Start looking somewhere else, and ignore case.
var filepath2 = findDown('{a,b}*.txt', {cwd: '/some/path', nocase: true});

// Start looking somewhere else, and ignore specific files or directories.
var filepath3 = findDown('{a,b}*.txt', {cwd: '/some/path', exclude: ['directory/', 'some.file']});
  • patterns {String|Array}: Glob pattern(s) or file path(s) to match against.
  • options {Object}: Options to pass to micromatch and exclude-match. Note that if you want to start in a different directory than the current working directory, specify a cwd property here. Files and Directories can be excluded by specifying an exclude property.
  • returns {Array}: Returns a list of matching files.

Running tests

Install dev dependencies:

$ npm install -d && npm test

Contributing

Take care to maintain the existing coding style. Add unit tests for any new or changed functionality.

For bugs or feature requests, please create an issue.

Release History

2016-10-06 - v1.0.2 - Modified CI build config.
2016-10-06 - v1.0.1 - Updated README build status.
2016-10-06 - v1.0.0 - Updated README. Refactored for exclusion-match.
2016-10-01 - v0.2.0 - Updated dependencies. Deprecated exclude function and moved it into a separate dependency.
2016-09-20 - v0.1.0 - Initial release.

Author

"Captain" Morgan Worrell

License

Copyright © 2016, "Captain" Morgan Worrell.
Released under the MIT license.