Skip to content

Classes

Edge

Defined in: edge.ts:10

Implements

Constructors

new Edge()
new Edge(
type,
spec,
from,
to?): Edge

Defined in: edge.ts:48

Parameters
type

DependencyTypeShort

spec

Spec

from

Node

to?

Node

Returns

Edge

Properties

from
from: Node

Defined in: edge.ts:31

The Node this Edge is connecting from, this is usually the dependent.

Implementation of
EdgeLike.from
spec
spec: Spec

Defined in: edge.ts:46

The defined spec value for to as parsed from the dependent metadata.

Implementation of
EdgeLike.spec
to?
optional to: Node;

Defined in: edge.ts:36

The node this Edge is connecting to, this is usually a direct dependency.

Implementation of
EdgeLike.to
type
type: DependencyTypeShort

Defined in: edge.ts:41

What type of dependency relationship from and to nodes have.

Implementation of
EdgeLike.type

Accessors

[toStringTag]
Get Signature
get toStringTag: string

Defined in: edge.ts:11

Returns

string

dev
Get Signature
get dev(): boolean

Defined in: edge.ts:70

This edge was defined as part of a devDependencies in package.json

Returns

boolean

name
Get Signature
get name(): string

Defined in: edge.ts:63

The name of the dependency to as defined in the dependent metadata.

Returns

string

Implementation of
EdgeLike.name
optional
Get Signature
get optional(): boolean

Defined in: edge.ts:74

Returns

boolean

peer
Get Signature
get peer(): boolean

Defined in: edge.ts:78

Returns

boolean

peerOptional
Get Signature
get peerOptional(): boolean

Defined in: edge.ts:82

Returns

boolean

Methods

[kCustomInspect]()
kCustomInspect: string

Defined in: edge.ts:15

Parameters
_

number

options

InspectOptions

Returns

string

valid()
valid(): boolean

Defined in: edge.ts:86

Returns

boolean


Graph

Defined in: graph.ts:44

Implements

Constructors

new Graph()
new Graph(options): Graph

Defined in: graph.ts:108

Parameters
options

GraphOptions

Returns

Graph

Properties

edges
edges: Set<Edge>

Defined in: graph.ts:66

A set of all edges in this graph.

Implementation of
GraphLike.edges
extraneousDependencies
extraneousDependencies: Set<Edge>

Defined in: graph.ts:101

A set of extraneous dependencies found when building the graph.

importers
importers: Set<Node>

Defined in: graph.ts:91

A set of importer nodes in this graph.

Implementation of
GraphLike.importers
mainImporter
mainImporter: Node

Defined in: graph.ts:96

The Node that represents the project root package.json.

Implementation of
GraphLike.mainImporter
manifests
manifests: ManifestInventory

Defined in: graph.ts:61

An inventory with all manifests related to an install.

monorepo?
optional monorepo: Monorepo;

Defined in: graph.ts:56

A Monorepo instance, used for managing workspaces.

nodes
nodes: Map<DepID, Node>

Defined in: graph.ts:71

Map registered dep ids to the node that represent them in the graph.

Implementation of
GraphLike.nodes
nodesByName
nodesByName: Map<string, Set<Node>>

Defined in: graph.ts:76

Map of nodes by their name

projectRoot
projectRoot: string

Defined in: graph.ts:106

The root of the project this graph represents

Implementation of
GraphLike.projectRoot
resolutions
resolutions: Map<string, Node>

Defined in: graph.ts:81

Cached resolutions for spec lookups

resolutionsReverse
resolutionsReverse: Map<Node, Set<string>>

Defined in: graph.ts:86

Reverse map of resolutions

Accessors

[toStringTag]
Get Signature
get toStringTag: string

Defined in: graph.ts:45

Returns

string

Methods

[kCustomInspect]()
kCustomInspect: string

Defined in: graph.ts:409

Parameters
_

number

options

InspectOptions

Returns

string

addEdge()
addEdge(
type,
spec,
from,
to?): Edge

Defined in: graph.ts:190

Create a new edge between two nodes of the graph in case both exist, in case the destination node does not exists, then a dangling edge, pointing to nothing will be created to represent that missing dependency.

Parameters
type

DependencyTypeShort

spec

Spec

from

NodeLike

to?

NodeLike

Returns

Edge

Implementation of
GraphLike.addEdge
addNode()
addNode(
id?,
manifest?,
spec?,
name?,
version?): Node

Defined in: graph.ts:263

Create a new node in the graph.

Parameters
id?

DepID

manifest?

Manifest

spec?

Spec

name?

string

version?

string

Returns

Node

Implementation of
GraphLike.addNode
findResolution()
findResolution(spec, fromNode): undefined | Node

Defined in: graph.ts:232

Find an existing node to satisfy a dependency

Parameters
spec

Spec

fromNode

Node

Returns

undefined | Node

gc()
gc(): Map<DepID, Node>

Defined in: graph.ts:164

Delete all nodes that are unreachable from the importers. The collection of deleted nodes is returned.

NOTE: This can be extremely slow for large graphs, and is almost always unnecessary! Only call when it is known that some unreachable nodes may have been created, for example when deleting the unneeded subgraph when an optional node fails to resolve/install.

Returns

Map<DepID, Node>

placePackage()
placePackage(
fromNode,
depType,
spec,
manifest?,
id?): undefined | Node

Defined in: graph.ts:307

Place a new package into the graph representation, creating the new edges and possibly new nodes that are to be expected when traversing the graph in a top-down direction, e.g: from importers to leafs.

For different uses that are not a direct top-down traversal of the graph consider using addNode() and addEdge() instead.

Parameters
fromNode

Node

depType

DependencyTypeShort

spec

Spec

manifest?

Manifest

id?

DepID

Returns

undefined | Node

removeNode()
removeNode(node, replacement?): void

Defined in: graph.ts:369

Removes a node and its relevant edges from the graph.

If a replacement is provided, then any edges that were previously pointing to the removed node will be directed to the replacement, if it is valid to do so.

Parameters
node

Node

replacement?

Node

Returns

void

toJSON()
toJSON(): LockfileData

Defined in: graph.ts:401

Returns

LockfileData


Node

Defined in: node.ts:23

Implements

Constructors

new Node()
new Node(
options,
id?,
manifest?,
spec?,
name?,
version?): Node

Defined in: node.ts:204

Parameters
options

NodeOptions

id?

DepID

manifest?

Manifest

spec?

Spec

name?

string

version?

string

Returns

Node

Properties

edgesIn
edgesIn: Set<Edge>

Defined in: node.ts:85

List of edges coming into this node.

Implementation of
NodeLike.edgesIn
edgesOut
edgesOut: Map<string, Edge>

Defined in: node.ts:91

List of edges from this node into other nodes. This usually represents that the connected node is a direct dependency of this node.

Implementation of
NodeLike.edgesOut
graph
graph: GraphLike

Defined in: node.ts:111

A reference to the graph this node is a part of.

Implementation of
NodeLike.graph
id
id: DepID

Defined in: node.ts:96

A reference to the DepID this node represents in the graph.

Implementation of
NodeLike.id
importer
importer: boolean = false

Defined in: node.ts:101

True if this node is an importer node.

Implementation of
NodeLike.importer
integrity?
optional integrity: `sha512-${string}`;

Defined in: node.ts:116

The manifest integrity value.

Implementation of
NodeLike.integrity
mainImporter
mainImporter: boolean = false

Defined in: node.ts:106

True if this node is the project root node.

Implementation of
NodeLike.mainImporter
manifest?
optional manifest: Manifest;

Defined in: node.ts:121

The manifest this node represents in the graph.

Implementation of
NodeLike.manifest
projectRoot
projectRoot: string

Defined in: node.ts:126

Project where this node resides

Implementation of
NodeLike.projectRoot
registry?
optional registry: string;

Defined in: node.ts:133

For registry nodes, this is the registry we fetched them from. Needed because their un-prefixed dependencies need to come from the same registry, if it’s not the default.

resolved?
optional resolved: string;

Defined in: node.ts:159

An address PackageInfoClient may use to extract this package.

Implementation of
NodeLike.resolved
version?
optional version: string;

Defined in: node.ts:154

The version of the package represented by this node, this is usually equivalent to manifest.version but in a few ways it may differ such as nodes loaded from a lockfile that lacks a loaded manifest. This field should be used to retrieve package versions instead.

Implementation of
NodeLike.version

Accessors

[toStringTag]
Get Signature
get toStringTag: string

Defined in: node.ts:24

Returns

string

dev
Get Signature
get dev(): boolean

Defined in: node.ts:64

True if a node is only reachable via dev edges from any importer.

Setting this to false, if previously set to true, will also unset the flag on any dev-flagged non-dev dependencies.

Returns

boolean

Set Signature
set dev(dev): void

Defined in: node.ts:67

Parameters
dev

boolean

Returns

void

Implementation of
NodeLike.dev
location
Get Signature
get location(): string

Defined in: node.ts:164

The file system location for this node.

Returns

string

Set Signature
set location(location): void

Defined in: node.ts:174

Parameters
location

string

Returns

void

Implementation of
NodeLike.location
name
Get Signature
get name(): string

Defined in: node.ts:142

Returns

string

Implementation of
NodeLike.name
optional
Get Signature
get optional(): boolean

Defined in: node.ts:39

True if a node is only reachable via optional or peerOptional edges from any importer.

Setting this to false, if previously set to true, will also unset the flag on any optional-flagged non-optional dependencies.

Returns

boolean

Set Signature
set optional(optional): void

Defined in: node.ts:42

Parameters
optional

boolean

Returns

void

Implementation of
NodeLike.optional

Methods

addEdgesTo()
addEdgesTo(
type,
spec,
node?): Edge

Defined in: node.ts:306

Add an edge from this node connecting it to a direct dependency.

Parameters
type

DependencyTypeShort

spec

Spec

node?

Node

Returns

Edge

equals()
equals(other): boolean

Defined in: node.ts:256

Parameters
other

Node

Returns

boolean

inVltStore()
inVltStore(): boolean

Defined in: node.ts:238

return true if this node is located in the vlt store memoized the first time it’s called, since the store location doesn’t change within the context of a single operation.

Returns

boolean

isDev()
isDev(): this is Node & { dev: true }

Defined in: node.ts:78

Returns

this is Node & { dev: true }

isOptional()
isOptional(): this is Node & { optional: true }

Defined in: node.ts:53

Returns

this is Node & { optional: true }

nodeModules()
nodeModules(scurry): string

Defined in: node.ts:197

The location of the node_modules folder where this node’s edgesOut should be linked into. For nodes in the store, this is the parent directory, since they’re extracted into a node_modules folder side by side with links to their deps. For nodes outside of the store (ie, importers and arbitrary link deps) this is the node_modules folder directly inside the node’s directory.

Parameters
scurry

PathScurry

Returns

string

resolvedLocation()
resolvedLocation(scurry): string

Defined in: node.ts:185

The resolved location of the node in the file system.

Parameters
scurry

PathScurry

Returns

string

setDefaultLocation()
setDefaultLocation(): void

Defined in: node.ts:289

Returns

void

setImporterLocation()
setImporterLocation(location): void

Defined in: node.ts:263

Sets the node as an importer along with its location.

Parameters
location

string

Returns

void

setResolved()
setResolved(): void

Defined in: node.ts:273

Sets the appropriate resolve / integrity value for this node. Note that other places might also set these values, like for example the lockfile that might have already have this info.

Returns

void

Implementation of
NodeLike.setResolved
toJSON()
toJSON(): object

Defined in: node.ts:313

Returns

object

dev
dev: boolean
id
id: DepID
importer
importer: boolean
integrity
integrity: undefined | `sha512-${string}`
location
location: string
manifest
manifest: undefined | Manifest
name
name: string
optional
optional: boolean
projectRoot
projectRoot: string
resolved
resolved: undefined | string
version
version: undefined | string
toString()
toString(): string

Defined in: node.ts:329

Returns

string

Implementation of
NodeLike.toString

Type Aliases

ActualLoadOptions

type ActualLoadOptions = SpecOptions & object

Defined in: actual/load.ts:22

Type declaration

loadManifests?
optional loadManifests: boolean;

If set to false, actual.load will not load any package.json files while traversing the file system.

The resulting Graph from loading with loadManifests=false has no information on dependency types or the specs defined and no information on missing and extraneous dependencies.

mainManifest?
optional mainManifest: Manifest;

The project root manifest.

monorepo?
optional monorepo: Monorepo;

A Monorepo object, for managing workspaces

packageJson
packageJson: PackageJson

A PackageJson object, for sharing manifest caches

projectRoot
projectRoot: string

The project root dirname.

scurry
scurry: PathScurry

A PathScurry object, for use in globs

skipHiddenLockfile?
optional skipHiddenLockfile: boolean;

If set to true, then do not shortcut the process by reading the hidden lockfile at node_modules/.vlt-lock.json


AddImportersDependenciesMap

type AddImportersDependenciesMap = Map<
DepID,
Map<string, Dependency>
> &
object

Defined in: dependencies.ts:75

A Map in which keys are DepID linking to another Map in which keys are the dependency names and values are Dependency. This structure represents dependencies that need to be added to the importer represented by DepID.

The modifiedDependencies property can be used to indicate that there are added dependencies to any of the importer nodes.

Type declaration

modifiedDependencies
modifiedDependencies: boolean

BuildIdealOptions

type BuildIdealOptions = ActualLoadOptions & object

Defined in: ideal/build.ts:20

Type declaration

add?
optional add: AddImportersDependenciesMap;

A Map in which keys are DepID linking to another Map in which keys are the dependency names and values are Dependency. This structure represents dependencies that need to be added to the importer represented by DepID.

packageInfo
packageInfo: PackageInfoClient

A PackageInfoClient instance to read manifest info from.

remove?
optional remove: RemoveImportersDependenciesMap;

A Map object representing nodes to be removed from the ideal graph. Each DepID key represents an importer node and the Set of dependency names to be removed from its dependency list.


Dependency

type Dependency = object

Defined in: dependencies.ts:55

Parsed dependency entries info.

Type declaration

spec
spec: Spec

The parsed Spec object describing the dependency requirements.

type
type: DependencyTypeShort

The DependencyTypeShort, describing the type of dependency.


DependencyTypeLong

type DependencyTypeLong =
| 'dependencies'
| 'devDependencies'
| 'optionalDependencies'
| 'peerDependencies'

Defined in: dependencies.ts:9

Name of the package.json keys used to define different types of dependencies.


DependencyTypeShort

type DependencyTypeShort =
| 'dev'
| 'optional'
| 'peer'
| 'peerOptional'
| 'prod'

Defined in: dependencies.ts:18

Unique keys that define different types of dependencies relationship.


EdgeLike

type EdgeLike = object

Defined in: types.ts:6

Type declaration

from
from: NodeLike
name
name: string
spec
spec: SpecLikeBase
to?
optional to: NodeLike;
type
type: DependencyTypeShort

EdgeMap

type EdgeMap = Map<NodeLike | undefined, TreeItem>

Defined in: visualization/human-readable-output.ts:34


GraphLike

type GraphLike = object

Defined in: types.ts:14

Type declaration

addEdge()
addEdge: (type, spec, from, to?) => EdgeLike
Parameters
type

DependencyTypeShort

spec

Spec

from

NodeLike

to?

NodeLike

Returns

EdgeLike

addNode()
addNode: (id?, manifest?, spec?, name?, version?) => NodeLike
Parameters
id?

DepID

manifest?

Manifest

spec?

Spec

name?

string

version?

string

Returns

NodeLike

edges
edges: Set<EdgeLike>
importers
importers: Set<NodeLike>
mainImporter
mainImporter: NodeLike
nodes
nodes: Map<DepID, NodeLike>
projectRoot
projectRoot: string

GraphOptions

type GraphOptions = SpecOptions & object

Defined in: graph.ts:25

Type declaration

mainManifest
mainManifest: Manifest

The main importer manifest info.

manifests?
optional manifests: ManifestInventory;

An inventory of seen manifests.

monorepo?
optional monorepo: Monorepo;

A Monorepo object, for managing workspaces

projectRoot
projectRoot: string

Root of the project this graph represents


HumanReadableOutputGraph

type HumanReadableOutputGraph = object

Defined in: visualization/human-readable-output.ts:27

Type declaration

edges
edges: EdgeLike[];
highlightSelection?
optional highlightSelection: boolean;
importers
importers: Set<NodeLike>
nodes
nodes: NodeLike[];

JSONOutputGraph

type JSONOutputGraph = object

Defined in: visualization/json-output.ts:31

Type declaration

edges
edges: EdgeLike[];
nodes
nodes: NodeLike[];

JSONOutputItem

type JSONOutputItem = object

Defined in: visualization/json-output.ts:8

A JSON output item describes a package that is present in the install graph. It represents an edge plus it’s linking Node.

Type declaration

fromID?
optional fromID: DepID;

A reference to the id of the Node that this package is linked from.

name
name: string

The name of the package.

spec?
optional spec: string;

The dependency spec definition for this package.

to?
optional to: NodeLike;

A representation of the package object that fulfills this dependency.

type?
optional type: EdgeLike["type"];

The package type.


LockfileData

type LockfileData = object

Defined in: lockfile/types.ts:14

This is the main type definition for the contents of the vlt-lock.json file.

The nodes and edges information from the lockfile are used to reconstruct a Graph representing a previous install.

Type declaration

edges
edges: LockfileEdges
nodes
nodes: Record<DepID, LockfileNode>
options
options: SpecOptions

LockfileEdgeKey

type LockfileEdgeKey = `${DepID} ${string}`

Defined in: lockfile/types.ts:70

${from} ${dep name}


LockfileEdges

type LockfileEdges = object

Defined in: lockfile/types.ts:65

Lockfile edges are stored as a record object where the key is ${from.id} ${spec.name} and the value is ${type} ${spec.bareSpec} ${to.id | 'MISSING'}

Storing them in a record like this means that we are guaranteed to never end up with duplicates, and a standard JSON.stringify() will nicely print them out one line per edge.

Index Signature

[key:
| `·${string}·${string}·${string} ${string}`
| `git·${string}·${string}·${string} ${string}`
| `·${string}·${string} ${string}`
| `git·${string}·${string} ${string}`
| `file·${string}·${string} ${string}`
| `remote·${string}·${string} ${string}`
| `workspace·${string}·${string} ${string}`
| `file·${string} ${string}`
| `remote·${string} ${string}`
| `workspace·${string} ${string}`]:
| `optional ${string} ·${string}·${string}·${string}`
| `optional ${string} git·${string}·${string}·${string}`
| `optional ${string} ·${string}·${string}`
| `optional ${string} git·${string}·${string}`
| `optional ${string} file·${string}·${string}`
| `optional ${string} remote·${string}·${string}`
| `optional ${string} workspace·${string}·${string}`
| `optional ${string} file·${string}`
| `optional ${string} remote·${string}`
| `optional ${string} workspace·${string}`
| `optional ${string} MISSING`
| `dev ${string} ·${string}·${string}·${string}`
| `dev ${string} git·${string}·${string}·${string}`
| `dev ${string} ·${string}·${string}`
| `dev ${string} git·${string}·${string}`
| `dev ${string} file·${string}·${string}`
| `dev ${string} remote·${string}·${string}`
| `dev ${string} workspace·${string}·${string}`
| `dev ${string} file·${string}`
| `dev ${string} remote·${string}`
| `dev ${string} workspace·${string}`
| `dev ${string} MISSING`
| `peer ${string} ·${string}·${string}·${string}`
| `peer ${string} git·${string}·${string}·${string}`
| `peer ${string} ·${string}·${string}`
| `peer ${string} git·${string}·${string}`
| `peer ${string} file·${string}·${string}`
| `peer ${string} remote·${string}·${string}`
| `peer ${string} workspace·${string}·${string}`
| `peer ${string} file·${string}`
| `peer ${string} remote·${string}`
| `peer ${string} workspace·${string}`
| `peer ${string} MISSING`
| `peerOptional ${string} ·${string}·${string}·${string}`
| `peerOptional ${string} git·${string}·${string}·${string}`
| `peerOptional ${string} ·${string}·${string}`
| `peerOptional ${string} git·${string}·${string}`
| `peerOptional ${string} file·${string}·${string}`
| `peerOptional ${string} remote·${string}·${string}`
| `peerOptional ${string} workspace·${string}·${string}`
| `peerOptional ${string} file·${string}`
| `peerOptional ${string} remote·${string}`
| `peerOptional ${string} workspace·${string}`
| `peerOptional ${string} MISSING`
| `prod ${string} ·${string}·${string}·${string}`
| `prod ${string} git·${string}·${string}·${string}`
| `prod ${string} ·${string}·${string}`
| `prod ${string} git·${string}·${string}`
| `prod ${string} file·${string}·${string}`
| `prod ${string} remote·${string}·${string}`
| `prod ${string} workspace·${string}·${string}`
| `prod ${string} file·${string}`
| `prod ${string} remote·${string}`
| `prod ${string} workspace·${string}`
| `prod ${string} MISSING`

LockfileEdgeValue

type LockfileEdgeValue =
`${DependencyTypeShort} ${Spec['bareSpec']} ${DepID | 'MISSING'}`

Defined in: lockfile/types.ts:73

${type} ${spec} ${to}


LockfileLoadOptions

type LockfileLoadOptions = SpecOptions & object

Defined in: lockfile/load.ts:13

Type declaration

mainManifest
mainManifest: Manifest

The project root manifest.

monorepo?
optional monorepo: Monorepo;

A Monorepo object, for managing workspaces

packageJson?
optional packageJson: PackageJson;

A PackageJson object, for sharing manifest caches

projectRoot
projectRoot: string

The project root dirname.

scurry?
optional scurry: PathScurry;

A PathScurry object, for use in globs


LockfileNode

type LockfileNode = [
LockfileNodeFlags,
string | null,
Integrity | null,
string | null,
string | null,
Manifest | null,
]

Defined in: lockfile/types.ts:47

Lockfile representation of a node from the install graph.


LockfileNodeFlags

type LockfileNodeFlags = 0 | 1 | 2 | 3

Defined in: lockfile/types.ts:42

Bit flags indicating whether a node is optional and/or dev.


ManifestInventory

type ManifestInventory = Map<DepID, Manifest>

Defined in: graph.ts:20


MermaidOutputGraph

type MermaidOutputGraph = object

Defined in: visualization/mermaid-output.ts:6

Type declaration

edges
edges: EdgeLike[];
importers
importers: Set<NodeLike>
nodes
nodes: NodeLike[];

NodeLike

type NodeLike = object

Defined in: types.ts:35

Type declaration

dev
dev: boolean
edgesIn
edgesIn: Set<EdgeLike>
edgesOut
edgesOut: Map<string, EdgeLike>
graph
graph: GraphLike
id
id: DepID
importer
importer: boolean
integrity?
optional integrity: string | null;
location?
optional location: string;
mainImporter
mainImporter: boolean
manifest?
optional manifest: Manifest | null;
name?
optional name: string | null;
optional
optional: boolean
projectRoot
projectRoot: string
resolved?
optional resolved: string | null;
version?
optional version: string | null;
setResolved()
Returns

void

toString()
Returns

string


NodeOptions

type NodeOptions = SpecOptions & object

Defined in: node.ts:18

Type declaration

graph
graph: GraphLike
projectRoot
projectRoot: string

RawDependency

type RawDependency = object

Defined in: dependencies.ts:45

Dependency entries info as defined in a package.json file.

Type declaration

bareSpec
bareSpec: string
name
name: string
registry?
optional registry: string;
type
type: DependencyTypeLong

ReifyOptions

type ReifyOptions = ActualLoadOptions & object

Defined in: reify/index.ts:35

Type declaration

actual?
optional actual: Graph;
add?
optional add: AddImportersDependenciesMap;
graph
graph: Graph
packageInfo
packageInfo: PackageInfoClient
remove?
optional remove: RemoveImportersDependenciesMap;

RemoveImportersDependenciesMap

type RemoveImportersDependenciesMap = Map<DepID, Set<string>> & object

Defined in: dependencies.ts:88

A Map object representing nodes to be removed from the ideal graph. Each DepID key represents an importer node and the Set of dependency names to be removed from its dependency list.

The modifiedDependencies property can be used to indicate that there are added dependencies to any of the importer nodes.

Type declaration

modifiedDependencies
modifiedDependencies: boolean

SaveOptions

type SaveOptions = SpecOptions & object

Defined in: lockfile/save.ts:24

Type declaration

graph
graph: Graph

The graph to be stored in the lockfile.

saveManifests?
optional saveManifests: boolean;

Should it save manifest data in the lockfile?


TreeItem

type TreeItem = object

Defined in: visualization/human-readable-output.ts:15

Type declaration

deduped
deduped: boolean
edge
edge: EdgeLike | undefined
hasSibling
hasSibling: boolean
include
include: boolean
name?
optional name: string | null;
node
node: NodeLike | undefined
padding
padding: string
parent
parent: TreeItem | undefined
prefix
prefix: string

TreeMap

type TreeMap = Map<EdgeLike | undefined, EdgeMap>

Defined in: visualization/human-readable-output.ts:36

Variables

actual

const actual: object

Defined in: index.ts:16

Type declaration

load()
load: options => (Graph = actualLoad)

Read the file system looking for node_modules folders and returns a new Graph that represents the relationship between the dependencies found.

Parameters
options

ActualLoadOptions

Returns

Graph


dependencyTypes

const dependencyTypes: Map<DependencyTypeLong, DependencyTypeShort>

Defined in: dependencies.ts:137

Maps between long form names usually used in package.json files to a corresponding short form name, used in lockfiles.


ideal

const ideal: object

Defined in: index.ts:37

Type declaration

build()
build: options => Promise<Graph>

Builds an ideal Graph representing the dependencies that should be present in order to fulfill the requirements defined by the package.json and vlt-lock.json files using either the virtual or actual graph as a starting point. Also add / remove any dependencies listed in the add and remove properties.

Parameters
options

BuildIdealOptions

Returns

Promise<Graph>


lockfile

const lockfile: object

Defined in: index.ts:25

Type declaration

load()
load: options => (Graph = lockfileLoad)
Parameters
options

LockfileLoadOptions

Returns

Graph

loadEdges()
loadEdges: (graph, edges, options) => void;
Parameters
graph

GraphLike

edges

LockfileEdges

options

SpecOptions

Returns

void

loadNodes()
loadNodes: (graph, nodes) => void;
Parameters
graph

GraphLike

nodes

Record<DepID, LockfileNode>

Returns

void

save()
save: (options) => void;
Parameters
options

SaveOptions

Returns

void


LockfileNodeFlagDev

const LockfileNodeFlagDev: 2 = 2

Defined in: lockfile/types.ts:36


LockfileNodeFlagDevOptional

const LockfileNodeFlagDevOptional: 3 = 3

Defined in: lockfile/types.ts:37


LockfileNodeFlagNone

const LockfileNodeFlagNone: 0 = 0

Defined in: lockfile/types.ts:34


LockfileNodeFlagOptional

const LockfileNodeFlagOptional: 1 = 1

Defined in: lockfile/types.ts:35


longDependencyTypes

const longDependencyTypes: Set<DependencyTypeLong>

Defined in: dependencies.ts:115

A set of the possible long dependency type names, as used in package.json files.


shortDependencyTypes

const shortDependencyTypes: Set<DependencyTypeShort>

Defined in: dependencies.ts:125

A set of the short type keys used to represent dependency relationships.

Functions

asDependency()

function asDependency(obj): Dependency

Defined in: dependencies.ts:104

Parameters

obj

unknown

Returns

Dependency


asDependencyTypeShort()

function asDependencyTypeShort(obj): DependencyTypeShort

Defined in: dependencies.ts:30

Parameters

obj

unknown

Returns

DependencyTypeShort


getBooleanFlagsFromNum()

function getBooleanFlagsFromNum(flags): object

Defined in: lockfile/types.ts:29

Parameters

flags

LockfileNodeFlags

Returns

object

dev
dev: boolean
optional
optional: boolean

getFlagNumFromNode()

function getFlagNumFromNode(node): 0 | 1 | 2 | 3

Defined in: lockfile/types.ts:20

Parameters

node
dev

boolean

optional

boolean

Returns

0 | 1 | 2 | 3


humanReadableOutput()

function humanReadableOutput(
options,
__namedParameters,
): undefined | null | string

Defined in: visualization/human-readable-output.ts:98

Returns a human-readable output of the graph.

Parameters

options

HumanReadableOutputGraph

__namedParameters
colors

ChalkInstance

Returns

undefined | null | string


isDependency()

function isDependency(o): o is Dependency

Defined in: dependencies.ts:97

Parameters

o

unknown

Returns

o is Dependency


isDependencyTypeShort()

function isDependencyTypeShort(obj): obj is DependencyTypeShort

Defined in: dependencies.ts:25

Parameters

obj

unknown

Returns

obj is DependencyTypeShort


jsonOutput()

function jsonOutput(__namedParameters): JSONOutputItem[]

Defined in: visualization/json-output.ts:39

Returns a JSON string representation of the graph.

Parameters

__namedParameters

JSONOutputGraph

Returns

JSONOutputItem[]


mermaidOutput()

function mermaidOutput(__namedParameters): string

Defined in: visualization/mermaid-output.ts:67

Returns a mermaid string representation of the graph.

Parameters

__namedParameters

MermaidOutputGraph

Returns

string


reify()

function reify(options): Promise<void>

Defined in: reify/index.ts:46

Make the current project match the supplied graph.

Parameters

options

ReifyOptions

Returns

Promise<void>


shorten()

function shorten(typeLong, name?, manifest?): DependencyTypeShort

Defined in: dependencies.ts:150

Get the DependencyTypeShort from a DependencyTypeLong.

Parameters

typeLong

DependencyTypeLong

name?

string

manifest?

Manifest

Returns

DependencyTypeShort


stringifyNode()

function stringifyNode(node?): string

Defined in: stringify-node.ts:4

Parameters

node?

NodeLike

Returns

string