Skip to content

Instantly share code, notes, and snippets.

@amilajack
Last active January 26, 2019 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amilajack/d1def1e9669bbfde2592b117247d0390 to your computer and use it in GitHub Desktop.
Save amilajack/d1def1e9669bbfde2592b117247d0390 to your computer and use it in GitHub Desktop.
esnextbin sketch
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ESNextbin Sketch</title>
<!-- put additional styles and scripts here -->
</head>
<body>
<!-- put markup and other contents here -->
<img src="" alt="">
</body>
</html>
const toposort = require('toposort')
const graph = [
// From // To
// ['ro', 'tie your shoes'],
['babel', 'rollup'],
['eslint', 'babel'],
['redux', 'babel'],
['react', 'babel']
]
// Now, sort the vertices topologically, to reveal a legal execution order.
console.log(toposort(graph));
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
"toposort": "2.0.2"
}
}
'use strict';
var toposort = require('toposort');
var graph = [
// From // To
// ['ro', 'tie your shoes'],
['babel', 'rollup'], ['eslint', 'babel'], ['redux', 'babel'], ['react', 'babel']];
// Now, sort the vertices topologically, to reveal a legal execution order.
console.log(toposort(graph));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment