---
title: "@dagrejs/graphlib 4.0.1 Breaking Changes on npm | Since.dev"
description: "What each @dagrejs/graphlib release removed, renamed or changed: 17 breaking changes in 1 version on npm, each with its source."
canonical_url: https://since.dev/packages/npm/@dagrejs/graphlib
last_updated: 2026-12-04
---

# @dagrejs/graphlib breaking changes

@dagrejs/graphlib 4.0.1 (March 8, 2026) is its newest release with breaking changes, 17 of them. The first: Removed alg. Every breaking API change we have recorded in @dagrejs/graphlib on npm: 17 breaking changes in 1 version. Below, its one version with breaking changes, newest first, removals and renames first, each with its source.

Updated December 4, 2026

Latest version `4.0.8`, released November 24, 2026. [Source repository](https://github.com/dagrejs/graphlib)

Packages on npm run on Node.js. [Node.js end of life dates](https://since.dev/calendar/nodejs.md).

## @dagrejs/graphlib 4.0.1 breaking changes

@dagrejs/graphlib 4.0.1, released March 8, 2026: 17 breaking changes.

- **Removed** `alg`  

alg was removed in @dagrejs/graphlib 4.0.1 [npmjs.com](https://www.npmjs.com/package/@dagrejs/graphlib/v/4.0.1)
- **Removed** `json`  

json was removed in @dagrejs/graphlib 4.0.1 [npmjs.com](https://www.npmjs.com/package/@dagrejs/graphlib/v/4.0.1)
- **Signature changed** `alg.dijkstra`  

Was function dijkstra(graph: Graph, source: string, weightFn?: (e: Edge) => number, edgeFn?: (v: string) => Edge\[\]): {\[node: string\]: Path}; now function dijkstra(graph: Graph, source: string, weightFn?: WeightFunction, edgeFn?... [npmjs.com](https://www.npmjs.com/package/@dagrejs/graphlib/v/4.0.1)
- **Signature changed** `alg.dijkstraAll`  

Was function dijkstraAll(graph: Graph, weightFn?: (e: Edge) => number, edgeFn?: (v: string) => Edge\[\]): {\[source: string\]: {\[node: string\]: Path}}; now function dijkstraAll(graph: Graph, weightFn?: WeightFunction, edgeFn?: EdgeFunction)... [npmjs.com](https://www.npmjs.com/package/@dagrejs/graphlib/v/4.0.1)
- **Signature changed** `alg.floydWarshall`  

Was function floydWarshall(graph: Graph, weightFn?: (e: Edge) => number, edgeFn?: (v: string) => Edge\[\]): {\[source: string\]: {\[node: string\]: Path}}; now function floydWarshall(graph: Graph, weightFn?: WeightFunction, edgeFn?... [npmjs.com](https://www.npmjs.com/package/@dagrejs/graphlib/v/4.0.1)
- **Signature changed** `alg.postorder`  

Was function postorder(graph: Graph, vs: string\[\]): string\[\]; now function postorder(graph: Graph, vs: string | string\[\]): string\[\]. [npmjs.com](https://www.npmjs.com/package/@dagrejs/graphlib/v/4.0.1)
- **Signature changed** `alg.preorder`  

Was function preorder(graph: Graph, vs: string\[\]): string\[\]; now function preorder(graph: Graph, vs: string | string\[\]): string\[\]. [npmjs.com](https://www.npmjs.com/package/@dagrejs/graphlib/v/4.0.1)
- **Signature changed** `alg.prim`  

Was function prim(graph: Graph, weightFn: (e: Edge) => number): Graph; now function prim(graph: Graph, weightFn: WeightFunction): Graph. [npmjs.com](https://www.npmjs.com/package/@dagrejs/graphlib/v/4.0.1)
- **Signature changed** `Graph.children`  

Was children(v: string): string\[\]; now children(v?: string): string\[\]. [npmjs.com](https://www.npmjs.com/package/@dagrejs/graphlib/v/4.0.1)
- **Signature changed** `Graph.constructor`  

Was constructor(options?: GraphOptions); now constructor(opts?: GraphOptions). [npmjs.com](https://www.npmjs.com/package/@dagrejs/graphlib/v/4.0.1)
- **Signature changed** `Graph.edge`  

Was edge(e: Edge): EdgeLabel; now edge(edge: Edge): EdgeLabel. [npmjs.com](https://www.npmjs.com/package/@dagrejs/graphlib/v/4.0.1)
- **Signature changed** `Graph.edgeAsObj`  

Was edgeAsObj(e: Edge): Object edgeAsObj(v: string, w: string, name?: string): Object; now edgeAsObj(edge: Edge): {label: EdgeLabel;} edgeAsObj(v: string, w: string, name?: string): {label: EdgeLabel;}. [npmjs.com](https://www.npmjs.com/package/@dagrejs/graphlib/v/4.0.1)
- **Signature changed** `Graph.setDefaultEdgeLabel`  

Was setDefaultEdgeLabel(labelOrFn: EdgeLabel | ((v: string, w: string, name?: string) => EdgeLabel)): this; now setDefaultEdgeLabel(labelOrFn: EdgeLabel | EdgeLabelFactory\<EdgeLabel>): this. [npmjs.com](https://www.npmjs.com/package/@dagrejs/graphlib/v/4.0.1)
- **Signature changed** `Graph.setDefaultNodeLabel`  

Was setDefaultNodeLabel(labelOrFn: NodeLabel | ((v: string) => NodeLabel)): this; now setDefaultNodeLabel(labelOrFn: NodeLabel | NodeLabelFactory\<NodeLabel>): this. [npmjs.com](https://www.npmjs.com/package/@dagrejs/graphlib/v/4.0.1)
- **Signature changed** `Graph.setParent`  

Was setParent(v: string, p?: string): this; now setParent(v: string, parent?: string): this. [npmjs.com](https://www.npmjs.com/package/@dagrejs/graphlib/v/4.0.1)
- **Signature changed** `json.read`  

Was function read\<GraphLabel = any, NodeLabel = any, EdgeLabel = any>(json: Object): Graph\<GraphLabel, NodeLabel, EdgeLabel>; now function read\<GraphLabel = any, NodeLabel = any, EdgeLabel = any>(json: JsonGraph): Graph\<GraphLabel... [npmjs.com](https://www.npmjs.com/package/@dagrejs/graphlib/v/4.0.1)
- **Signature changed** `json.write`  

Was function write(graph: Graph): Object; now function write(graph: Graph): JsonGraph. [npmjs.com](https://www.npmjs.com/package/@dagrejs/graphlib/v/4.0.1)

## Related packages

- [@dagrejs/dagre](https://since.dev/packages/npm/@dagrejs/dagre.md)

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#api) reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

## Put your code on continuous maintenance.

Scan a public repository now, or give your agent one line.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
