read-closest-package
Reads the closest package.json file and parses its JSON.
{ console console console}
Also has a sync API which returns null
on any errors:
var closest = var pkg = closestif pkg console
Usage
closest([opt], cb)
Looks for the closest package and calls the callback cb
with (err, data, filename)
.
cwd
the working directory to search up from for the package.json (defaults toprocess.cwd()
)filter
a filter passed to closest-package
If there was an error finding the pacakge or parsing JSON, err
will be non-null.
data = closest.sync([opt])
The same as above, but synchronous. Returns null on any errors.
See Also
License
MIT, see LICENSE.md for details.