@hapi/topo
Topological sorting with grouping support
@haragei/dag
A Directed Acyclic Graph (DAG) library with online cycle detection and topological ordering.
batching-toposort
Efficiently sort interdependent tasks into a sequence of concurrently-executable batches.