node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org »

deptree

DepTree

Installation

npm install deptree

Usage

var DepTree = require('deptree');
var depTree = new DepTree();
depTree.add('a');
depTree.add('b', ['c', 'a']);
depTree.add('d', 'b');
 
var resolve = depTree.resolve();
//resolve == [ 'a', 'c', 'b', 'd' ]