Find a file by walking up parent directories
npm install find-up-glob



![david dependency]()
![david dev-dependency]()
> Find a file by walking up parent directories
>
> Like find-up but using minimatch
``bash`
$ npm install --save find-up-glob
``
/
└── Users
└── tanhauhau
├── unicorn.png
└── foo
└── bar
├── a.js
└── b.js
└── awesome.txt
└── super.txt
`javascript
var findUpGlob = require('find-up-glob');
//asynchronous using promise
findUpGlob('*.js').then(function(files){
console.log(files)
//=> ['/Users/tanhauhau/foo/bar/a.js', '/Users/tanhauhau/foo/bar/b.js']
})
//synchronous
var files = findUpGlob.sync('*.txt');
//=> ['/Users/tanhauhau/foo/awesome.txt', '/Users/tanhauhau/foo/super.txt']
`
Returns a promise for the array of filepath or null.
Returns an array of filepath or null.
glob
Type: string
Glob pattern for filename matching, using minimatch to match
options
cwd
Type: string process.cwd()
Default:
Directory to start from.
To match a parent folder you should use:
findUpGlob('*/bar/.js') instead of findUpGlob('/bar/*.js')
1. Fork it!
2. Create your feature branch: git checkout -b my-new-featuregit commit -am 'Add some feature'
3. Commit your changes: git push origin my-new-feature`
4. Push to the branch:
5. Submit a pull request :D