
Research
PyPI Package Impersonates SymPy to Deliver Cryptomining Malware
Malicious PyPI package sympy-dev targets SymPy users, a Python symbolic math library with 85 million monthly downloads.
@vltpkg/graph
Advanced tools
A library that helps understanding & expressing what happens on an install
This is the graph library responsible for representing the packages that are involved in a given install.
Overview · Concepts · Architecture · API · Usage · Related Workspaces · References
The @vltpkg/graph workspace models a project's dependency
relationships and drives npm-compatible installs by computing how
node_modules should be structured. It exposes a public API through
src/index.ts that re-exports core types and workflows.
At a glance:
Graph encapsulates the full dependency graph for a project
(including monorepo workspaces), and is the source of truth for how
to lay out node_modules.Node represents a unique package instance (uniqueness provided by
@vltpkg/dep-id).Edge represents a dependency relationship from a dependent to a
dependency (eg. dependencies, devDependencies,
peerDependencies, etc.).Diff describes the minimal set of changes required to transform an
Actual graph (disk) into an Ideal graph (desired outcome), which is
then applied by the reify subsystem.mainImporter is the project root (its package.json), and the
remaining importers are workspaces discovered by
@vltpkg/workspaces.node_modules/.vlt-lock.json mirroring the current on-disk state to
accelerate subsequent loads of the Actual graph.vlt.json.actual.load(options): GraphRecursively loads the node_modules folder found at projectRoot in
order to create a graph representation of the current installed
packages.
ideal.build(options): Promise<Graph>Builds the ideal dependency graph by loading from lockfile (preferred)
or actual graph, then expanding dependencies by fetching manifests.
Requires packageInfo and remover in addition to standard options.
lockfile.load(options): GraphLoads the lockfile file found at projectRoot and returns the graph.
lockfile.save(options): voidSaves the graph to vlt-lock.json.
reify(options): Promise<ReifyResult>Computes a Diff between the Actual and Ideal graphs and applies the
minimal filesystem changes (creating/deleting links, writing
lockfiles, hoisting, lifecycle scripts) to make the on-disk install
match the Ideal graph. Returns { diff, buildQueue }.
install(options, add?): Promise<{ graph, diff, buildQueue }>High-level install orchestration that handles graph building, reify,
and lockfile management. Supports --frozen-lockfile,
--clean-install, and --lockfile-only modes.
mermaidOutput(graph): stringGenerates Mermaid flowchart syntax from graph data.
humanReadableOutput(graph, options): stringGenerates ASCII tree output with optional colors. Used in vlt ls.
jsonOutput(graph): JSONOutputItem[]Returns array of {name, fromID, spec, type, to, overridden} items.
import { install } from '@vltpkg/graph'
const { graph, diff, buildQueue } = await install({
projectRoot: process.cwd(),
packageInfo,
packageJson,
scurry,
allowScripts: '*',
})
import { actual, ideal, reify } from '@vltpkg/graph'
import { RollbackRemove } from '@vltpkg/rollback-remove'
const remover = new RollbackRemove()
// Load current on-disk state
const from = actual.load({
projectRoot: process.cwd(),
packageJson,
scurry,
loadManifests: true,
})
// Build intended end state (may start from lockfile or actual)
const to = await ideal.build({
projectRoot: process.cwd(),
packageInfo,
packageJson,
scurry,
remover,
})
// Apply minimal changes to match Ideal
const { diff, buildQueue } = await reify({
graph: to,
actual: from,
packageInfo,
packageJson,
scurry,
remover,
allowScripts: '*',
})
import { lockfile } from '@vltpkg/graph'
// Load virtual graph from vlt-lock.json
const graph = lockfile.load({
projectRoot,
mainManifest,
packageJson,
})
// Save to vlt-lock.json
lockfile.save({ graph })
import {
mermaidOutput,
humanReadableOutput,
jsonOutput,
} from '@vltpkg/graph'
// Mermaid flowchart (for docs, dashboards)
const mermaid = mermaidOutput({
edges: [...graph.edges],
nodes: [...graph.nodes.values()],
importers: graph.importers,
})
// ASCII tree with colors (used in `vlt ls`)
const tree = humanReadableOutput(
{
edges: [...graph.edges],
nodes: [...graph.nodes.values()],
importers: graph.importers,
},
{ colors: true },
)
// JSON array of dependency items
const json = jsonOutput({
edges: [...graph.edges],
nodes: [...graph.nodes.values()],
importers: graph.importers,
})
Graph construction modes supported by the library:
Virtual Graphs (lockfile-based)
src/lockfile/load.ts and
src/lockfile/save.tsnode_modules/.vlt-lock.json for faster loadsActual Graphs (filesystem-based)
node_modules via src/actual/load.tssrc/reify/Ideal Graphs (desired end state)
src/ideal/build.tsadd/remove input with importer manifests using
src/ideal/get-importer-specs.ts@vltpkg/package-info, reuses
existing nodes that satisfy specsFinally, src/diff.ts computes changes and src/reify/ applies them
to the filesystem.
@vltpkg/dep-id: Unique IDs for packages, ensuring Node identity@vltpkg/spec: Parse/normalize dependency specifiers and registry
semantics@vltpkg/semver: Semantic version parsing/comparison@vltpkg/satisfies: Check if a DepID satisfies a Spec@vltpkg/package-info: Fetch remote manifests and artifacts
(registry, git, tarball)@vltpkg/package-json: Read and cache local package.json files@vltpkg/workspaces: Monorepo workspace discovery and grouping@vltpkg/rollback-remove: Safe file removal with rollback
capability@vltpkg/vlt-json: Load vlt.json configuration (modifiers, etc.)FAQs
A library that helps understanding & expressing what happens on an install
The npm package @vltpkg/graph receives a total of 275 weekly downloads. As such, @vltpkg/graph popularity was classified as not popular.
We found that @vltpkg/graph demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Malicious PyPI package sympy-dev targets SymPy users, a Python symbolic math library with 85 million monthly downloads.

Security News
Node.js 25.4.0 makes require(esm) stable, formalizing CommonJS and ESM compatibility across supported Node versions.

Product
Create and share saved alert views with custom tabs on the org alerts page, making it easier for teams to return to consistent, named filter sets.