PackageGraph <T>
Index
Constructors
Methods
Constructors
constructor
Type parameters
Methods
addPackage
addPackages
Add multiple packages.
resolveBatchList
Resolve the dependency graph and return a list of batched
package.json
objects (array of arrays) in the order they are depended on.graph.resolveBatchList().forEach((pkgs) => {
pkgs.forEach((pkg) => {
console.log(pkg.name);
});
});
resolveList
Resolve the dependency graph and return a list of all
package.json
objects in the order they are depended on.graph.resolveList().forEach((pkg) => {
console.log(pkg.name);
});
resolveTree
Resolve the dependency graph and return a tree of nodes for all
package.json
objects and their dependency mappings.graph.resolveTree().nodes.forEach((node) => {
console.log(node.package.name);
if (node.nodes) {
// Dependents
}
});
Add a package by name with an associated
package.json
object. Will map a dependency between the package and its dependees found independencies
andpeerDependencies
.