Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@vltpkg/graph

Package Overview
Dependencies
Maintainers
5
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vltpkg/graph

A library that helps understanding & expressing what happens on an install

Source
npmnpm
Version
0.0.0-11
Version published
Weekly downloads
27
-51.79%
Maintainers
5
Weekly downloads
 
Created
Source

graph

@vltpkg/graph

This is the graph library responsible for representing the packages that are involved in a given install.

API · Usage

API

actual.load({ projectRoot: string }): Graph

Recursively loads the node_modules folder found at projectRoot in order to create a graph representation of the current installed packages.

async ideal.build({ projectRoot: string }): Promise<Graph>

This method returns a new Graph object, reading from the package.json file located at projectRoot dir and building up the graph representation of nodes and edges from the files read from the local file system.

lockfile.load({ mainManifest: Manifest, projectRoot: string }): Graph

Loads the lockfile file found at projectRoot and returns the graph.

Usage

Here's a quick example of how to use the @vltpkg/graph.ideal.build method to build a graph representation of the install defined at the projectRoot directory.

import { ideal } from '@vltpkg/graph'

const graph = await ideal.build({ projectRoot: process.cwd() })

FAQs

Package last updated on 01 May 2025

Did you know?

Socket

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.

Install

Related posts