node-resolve-recurse
Recursively resolve the paths of dependent node packages
Given the directory of a module (including the current module), generate a object with the names, versions, and paths of all modules that this module depends on, recursively.
Installation
npm install resolve-recurse
Usage
var resolve = ;;
options
is an Object containing up to 3 properties, outlined below.
If you do not pass options
to resolve
, it will simply assume all default options.
resolve
will pass an object to the callback function in the form:
Options
properties
-[String]
- Properties in the
package.json
to look for dependencies. - defaults to
['dependencies']
- Properties in the
path
-String
- Path to an npm module to start searching for dependencies.
- defaults to
__filename
relative
-String
- Path to the file that
path
should be resolved relative to. Useful if you are writing a library making use ofresolve-recurse
. - Only used if
path
is specified. - defaults to
__filename
- Path to the file that
filter
-Function(pkg)
- Determine whether or not to resolve a dependency.
- If this is a Function, it will be called with
pkg
, an object representation of the package.json file of each dependency, and is expected to returntrue
to continue resolving, orfalse
to ignore it. - Defaults to
null
(no filter)