travel/admin/node_modules/@hapi/topo
yaosen 242417d45d init... 2024-06-24 11:28:18 +08:00
..
lib init... 2024-06-24 11:28:18 +08:00
CHANGELOG.md init... 2024-06-24 11:28:18 +08:00
LICENSE.md init... 2024-06-24 11:28:18 +08:00
README.md init... 2024-06-24 11:28:18 +08:00
package.json init... 2024-06-24 11:28:18 +08:00

README.md

@hapi/topo

Topological sorting with grouping support.

Build Status

Usage

See the API Reference

Example

const Topo = require('topo');

const morning = new Topo();

morning.add('Nap', { after: ['breakfast', 'prep'] });

morning.add([
    'Make toast',
    'Pour juice'
], { before: 'breakfast', group: 'prep' });

morning.add('Eat breakfast', { group: 'breakfast' });

morning.nodes;        // ['Make toast', 'Pour juice', 'Eat breakfast', 'Nap']