jriecken / dependency-graph

A simple dependency graph for Node.js
http://jriecken.github.io/dependency-graph/
MIT License
330 stars 49 forks source link

[feature] ability to get 'entry' nodes #42

Closed amcdnl closed 3 years ago

amcdnl commented 3 years ago

Request

It would be ideal to extend the overallOrder to support returning only the 'entry' nodes.

Example

var graph = new DepGraph();
graph.addNode('a');
graph.addNode('b');
graph.addNode('c');

graph.addDependency('a', 'b');
graph.addDependency('b', 'c');

graph.entryNodes(); // => ['a']