I love this library! I was really happy to search for a specific problem on npm and then find the solution.
I'm mostly using it for the overallOrder() method, to get the proper order to execute a series of tasks in order to satisfy dependencies.
I'm now wondering if there's a way to get an order output based on a single node. Let's say I have a simple dependency graph like this:
three depends on two
two depends on one
one is just there
So if you call overallOrder(), you'd get ['one', 'two', 'three']. What I'd also like to do is calculate an order given a single node as a baseline. So the order based just on two would be ['two', 'three']. Obviously two is first because it's the baseline, and then its dependents are positioned after. The order based on three would just be ['three'] because the node three has no dependents.
I don't see anything in the existing API that could accomplish this, so I'm wondering if you can think of a workaround. Unless I'm missing something! Thanks for your time :)
I love this library! I was really happy to search for a specific problem on npm and then find the solution.
I'm mostly using it for the
overallOrder()
method, to get the proper order to execute a series of tasks in order to satisfy dependencies.I'm now wondering if there's a way to get an order output based on a single node. Let's say I have a simple dependency graph like this:
three
depends ontwo
two
depends onone
one
is just thereSo if you call
overallOrder()
, you'd get['one', 'two', 'three']
. What I'd also like to do is calculate an order given a single node as a baseline. So the order based just ontwo
would be['two', 'three']
. Obviouslytwo
is first because it's the baseline, and then its dependents are positioned after. The order based onthree
would just be['three']
because the nodethree
has no dependents.I don't see anything in the existing API that could accomplish this, so I'm wondering if you can think of a workaround. Unless I'm missing something! Thanks for your time :)