Back to Explore

jriecken/dependency-graph

GitHub
1 watchersOpen source

Last release:

This is a simple Node.js dependency graph library for building a graph of named nodes and their dependencies. It helps determine processing order and related sets, such as direct or transitive dependencies and dependants, and includes cycle detection for dependency cycles. Useful for computing an overall order of tasks where some items must be done before others.

Project status

  • Maintenance status: The most recent documented update is 1.0.0 from 2023-12-06, and the repo’s last upstream push was 2025-11-18. There is no evidence of published updates since 1.0.0, so overall it appears quiet, with limited outward updates.
  • Update cadence: Published updates were 0.10.0 (2021-01) and 0.11.0 (2021-03), then a long gap until 1.0.0 (2023-12). Since then, no additional tagged updates are shown, though there was at least one upstream push in late 2025.

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • 1.0.0

    Release 1.0.0 primarily refactors the library to use ES6 `Map` and `Set` instead of plain objects as pseudo `Map`/`Set` containers. The release notes claim this is non-functional except for a runtime requirement, and mention cloning the `circular` option. The code diff, however, reveals additional behavioral changes around how special object property names are handled, and a potential breaking change for consumers who inspect internal instance fields.

    Breaking
  • 0.11.0

    Release 0.11.0 adds a new API method, `entryNodes()`, to return nodes in the dependency graph that have no dependants (nothing depends on them). The change is also reflected in TypeScript typings, the README, and a new unit test to verify behavior.

    Features
  • 0.10.0

    Release 0.10.0 adds new APIs to query direct dependency relationships in the dependency graph, along with spelling aliases for existing transitive query methods. The code changes primarily introduce new prototype methods and corresponding TypeScript declaration updates.

    Features
  • 0.9.0

    Release 0.9.0 refactors the dependency graph topological sort DFS to handle large graphs safely and efficiently. The documented intent is removing recursion to avoid stack overflows and fixing an accidental O(N^2) behavior.

  • 0.8.1

    Release 0.8.1 primarily addresses ordering behavior in DepGraph.overallOrder when cycles are allowed (circular = true). The code change ensures nodes inside cyclic disconnected subgraphs are not omitted from the returned overall order.

  • 0.8.0

    Release 0.8.0 introduces a dedicated error type for detected dependency cycles. Instead of throwing a generic Error, cycle detection now throws DepGraphCycleError and attaches the cycle nodes via a cyclePath property.

    Features
  • 0.7.2

    Release 0.7.2 updates the TypeScript type definitions so the DepGraph constructor accepts an optional options parameter. The repository changes are limited to typings and test tooling, with no functional runtime code changes shown in the diff.

  • 0.7.1

    Release 0.7.1 is a metadata and TypeScript typing update. The release notes state it fixes the TypeScript definitions to include the new constructor arguments introduced in 0.7.0.

  • 0.7.0

    Release 0.7.0 adds support for handling circular dependencies. When enabled, cycle detection no longer throws during dependency traversal and ordering.

    Features
  • 0.6.0

    Release 0.6.0 adds two new public APIs to the dependency graph: a size() method to report the number of nodes, and a clone() method to create a copy of the graph. The release notes state that clone performs a shallow copy of custom node data.

    Features