@hapi/topo
Topological sorting with grouping support.
Usage
See the API Reference
Example
const Topo = require('topo');
const morning = new Topo();
.add('Nap', { after: ['breakfast', 'prep'] });
morning
.add([
morning'Make toast',
'Pour juice'
, { before: 'breakfast', group: 'prep' });
]
.add('Eat breakfast', { group: 'breakfast' });
morning
.nodes; // ['Make toast', 'Pour juice', 'Eat breakfast', 'Nap'] morning