package-lookup

0.1.2 • Public • Published

package-lookup

Info about the package given a filename.

Install:

npm install package-lookup

Usage:

var pkg = require('package-lookup');
 
// Display current package: The two gives the same result.
console.log(pkg.resolve(__filename));
console.log(pkg.resolveDir(__dirname));
 
// Info about socket.io (if it's in the path).
console.log(pkg.resolve(require.resolve('socket.io')));

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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    11
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    11
  • 0.1.1
    3
  • 0.1.0
    4

Package Sidebar

Install

npm i package-lookup

Weekly Downloads

4

Version

0.1.2

License

MIT

Last publish

Collaborators

  • walling