package-lookup
Info about the package given a filename.
Install:
npm install package-lookup
Usage:
var pkg = ; // Display current package: The two gives the same result.console;console; // Info about socket.io (if it's in the path).console;
Functions:
- pkg.resolve(filename)
- pkg.resolveDir(dirname)
The package info includes the properties _filename
and _dirname
that gives the filename and directory of the package.json file.