Find the closest package.json file meeting specific criteria
npm install closest-packageFind the closest package.json file meeting specific criteria by searching
upwards from a given directory until hitting root.

Given a starting directory dir, look up through every directory to see if
it contains a package.json file matching the filter function, for example:
`` javascript`
closest(__dirname, function(json, filename) {
return json.name === 'async'
}, function(err, file) {
console.log(file)
})
Note that filter is optional and takes the following arguments:
* json: the parsed package.json file.filename
* : the package.json's absolute filename.
Same as the closest function, however executed synchronously:
` javascript
var result = closest.sync(__dirname, function(json, filename) {
return json.name === 'async'
})
console.log(result)
``
MIT. See LICENSE.md for details.