module-info v1.2.3
module-info
Find package.json files in module and load information from it.
Help
Unfortunately I don't have any more time to maintain this repository :-(
Don't you want to save me and this project by taking over it?

Installation
$ npm install module-infoUsage
Base option is to set base directory of module.
var Info = require('module-info');
var info = new Info('/path/to/some/module');Find from file in module
If you have got some file somewhere in module directory tree, module-info can find information about module automatically.
var info = Info.fromFile('/path/to/some/module/and/some/file/in/it.js');Find by name (in node_modules)
You can search for information about some module on which your module is dependent.
var info = Info.fromName(module, 'dependent-module');Find for your module
This option is similar for example to package pkginfo.
var info = Info.self(module);Info object
getPackagePath(): returns path topackage.jsonfilegetData(): returns parsed JSON data frompackage.jsonfilegetName(): returns name of modulegetPath(): returns resolved path to modulegetVersion(): returns version of modulegetMainFile(): returns resolved full path to main file (even it is not defined inpackage.json)getModuleName(string filePath, bool relative = false): returns name for file in module used inrequiremethodisNpmDependency(): return true if module is dependency for another moduleisFileInModule(string filePath): checks if file is in module directory (not in any dependent sub-module)
Tests
$ npm testChangelog
1.2.3 + Move under Carrooi organization + Abandon package
1.2.2 + Bug with giving name of some files
1.2.1 +
getModuleNamecan return name relatively to base module directory1.2.0 + Added method
isNpmDependency+ Added methodisFileInModule+ MethodgetModuleNamethrow an error if file is not in module + Some refactoring in tests1.1.2 + Just typo in readme
1.1.11 + If main section in package.json is not defined and file
./index.jsexists, it will be returned fromgetMainFilemethod + MethodgetPackageDatarenamed togetData+ MethodgetPackageDatais now deprecated1.1.0 + Added getPath method + Added getModuleName method
1.0.0 + First version