-
node.name The name of this node's folder in node_modules.
-
node.parent Physical parent node in the tree. The package in whose
node_modules folder this package lives. Null if node is top of tree.
Setting node.parent will automatically update node.location and all
graph edges affected by the move.
-
node.meta A Shrinkwrap object which looks up resolved and
integrity values for all modules in this tree. Only relevant on root
nodes.
-
node.children Map of packages located in the node's node_modules
folder.
-
node.package The contents of this node's package.json file.
-
node.path File path to this package. If the node is a link, then this
is the path to the link, not to the link target. If the node is not a
link, then this matches node.realpath.
-
node.realpath The full real filepath on disk where this node lives.
-
node.location A slash-normalized relative path from the root node to
this node's path.
-
node.isLink Whether this represents a symlink. Always false for Node
objects, always true for Link objects.
-
node.isRoot True if this node is a root node. (Ie, if node.root === node.)
-
node.root The root node where we are working. If not assigned to some
other value, resolves to the node itself. (Ie, the root node's root
property refers to itself.)
-
node.isTop True if this node is the top of its tree (ie, has no
parent, false otherwise).
-
node.top The top node in this node's tree. This will be equal to
node.root for simple trees, but link targets will frequently be outside
of (or nested somewhere within) a node_modules hierarchy, and so will
have a different top.
-
node.dev, node.optional, node.devOptional, node.peer, Indicators
as to whether this node is a dev, optional, and/or peer dependency.
These flags are relevant when pruning dependencies out of the tree or
deciding what to reify. See Package Dependency Flags below for
explanations.
-
node.edgesOut Edges in the dependency graph indicating nodes that this
node depends on, which resolve its dependencies.
-
node.edgesIn Edges in the dependency graph indicating nodes that depend
on this node.
-
extraneous True if this package is not required by any other for any
reason. False for top of tree.
-
node.resolve(name) Identify the node that will be returned when code
in this package runs require(name)
-
node.errors Array of errors encountered while parsing package.json or
version specifiers.