包详细信息

topo

hapijs2.7mBSD-3-Clause不推荐使用3.0.3

This module has moved and is now available at @hapi/topo. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.

Topological sorting with grouping support

topological, sort, toposort, topsort

自述文件

topo

Topological sorting with grouping support.

Build Status

Lead Maintainer: Devin Ivy

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']