# @insysbio/topo-sort

> Simple and fast implementation of topological sorting. No dependencies. A circular graph will throw an error with circular nodes info.

Latest version **1.0.1** (published 2019-05-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @insysbio/topo-sort
pnpm add @insysbio/topo-sort
yarn add @insysbio/topo-sort
bun add @insysbio/topo-sort
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-05-27 |
| First published | 2019-05-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | liy |
| Maintainers | vetedde, metelkin |
| Keywords | graph, sort, topological, dependency |

## Links

- npm: https://www.npmjs.com/package/@insysbio/topo-sort
- Repository: https://github.com/metelkin/topo-sort
- Homepage: https://github.com/metelkin/topo-sort#readme
- Issues: https://github.com/metelkin/topo-sort/issues
- npm.io page: https://npm.io/package/@insysbio/topo-sort

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2019-05-27

## README

**This is fork from https://github.com/liy/topo-sort for more informative error object.**

# Error update
When the graph is cyclic than the Error object has property "circular" with the Array of circular ids.

# Usage
Must not add any null, undefined or empty string node.
```javascript
var TopoSort = require('topo-sort');

var tsort = new TopoSort();
tsort.add('a', ['b', 'c']);
tsort.add('d', ['a', 'b', 'c']);
// Output d,a,c,b
var l = tsort.sort();
```

---
_Source: https://npm.io/package/@insysbio/topo-sort · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
