Simple module to find dirs with git repo in
const gitDirsSearch require('git-dirs-search');
// or
import gitDirsSearch from 'git-dirs-search';
gitDirsSearch('/some/path/to/dir', (error, gitDirs) => {
if(error) {
throw error
}
gitDirs.map(gitDir => {
console.log(gitDir) // log out directory path (string)
})
/**
* do some think with data
* example data = [
* '/some/path/to/dir/gitRepository1',
* '/some/path/to/dir/other/someDir',
* '/some/path/to/dir/other/1/2/3/someDir',
* ]
})
gitDirsSearch(dir, callback, options)
Argument | Type | Default | Description |
---|---|---|---|
dir | string | *required | full path to dir to search repos in |
callback | function | *required | standart node-like callback function |
options | object | {...} | options object |
Option | Key | Default | Description |
---|---|---|---|
step | function | null | Method to be executed on single find a git repo |
maxDepth | number | 6 | How deep in dirs script will be searching |
ignores | array | ['node_modules', 'bower_components', 'vendor'] | Paths to ignore |
forceNode | boolean | false | By default script will use unix tree command if exists in of for performance. You can set this option to true, then script will always use standard node version |
Im open to contributors :).
- fix wrong options doc-block
- first stable version
Copyright (c) 2014 Grzegorz Klimek
Licensed under the MIT license.