{"_id":"toposort-class","_rev":"31-a64dd3175732471766cc06a8677d6e27","name":"toposort-class","description":"Topological sort of directed acyclic graphs (like dependecy lists)","dist-tags":{"latest":"1.0.1","beta":"1.0.0"},"versions":{"0.1.0":{"name":"toposort-class","version":"0.1.0","description":"Topological sort of directed acyclic graphs (like dependecy lists)","main":"index.js","repository":{"type":"git","url":"https://github.com/gustavohenke/node-toposort.git"},"keywords":["topological","sort","sorting","graphs","graph","dependency","list","dependencies","acyclic"],"author":"","license":"MIT","_id":"toposort-class@0.1.0","dist":{"shasum":"37f9dd47919b18d794c6ba95d0a1e149ca0f123f","tarball":"https://registry.npmjs.org/toposort-class/-/toposort-class-0.1.0.tgz","integrity":"sha512-XPhadt+JMYQiWNFiqo1hellWcRlAYxr/+klHVyoWPcvgJgJABr5B6h0WiFGF4jPbeJl+Bt9W6c/xdhAKDaKXuw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChDGe0g8v9QN90KemzIZhOAG9x/HySN5qIdotus4S2GwIgeOFxaSsOubBkr2LsKaRK8UNRwMcnzDBzVGkO4KuWd+Y="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"gustavohenke","email":"gustavo@injoin.com.br"},"maintainers":[{"name":"gustavohenke","email":"gustavo@injoin.com.br"}],"directories":{}},"0.1.1":{"name":"toposort-class","version":"0.1.1","description":"Topological sort of directed acyclic graphs (like dependecy lists)","main":"index.js","repository":{"type":"git","url":"https://github.com/gustavohenke/node-toposort.git"},"keywords":["topological","sort","sorting","graphs","graph","dependency","list","dependencies","acyclic"],"author":"","license":"MIT","_id":"toposort-class@0.1.1","dist":{"shasum":"f6bf2577b737c4da8f739a2552fb1a7f4ea5996e","tarball":"https://registry.npmjs.org/toposort-class/-/toposort-class-0.1.1.tgz","integrity":"sha512-/gDxYwdxw/uw3J9r1WTtDyohz4GvoOmpAfBcKLbr4sGRT4eZDkvKU743wKvM+NtXid9aNKF+VxWHu9R3+hfdGA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCI5bN4DHjAv9lXj7AWGWte2qpdp0fhr6Y7Ja9AbtRZogIgUbu5aSabNAbupRh/eePLsB/gEV0XW3X7xja7AFOP0VA="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"gustavohenke","email":"gustavo@injoin.com.br"},"maintainers":[{"name":"gustavohenke","email":"gustavo@injoin.com.br"}],"directories":{}},"0.1.2":{"name":"toposort-class","version":"0.1.2","description":"Topological sort of directed acyclic graphs (like dependecy lists)","main":"index.js","repository":{"type":"git","url":"https://github.com/gustavohenke/node-toposort.git"},"keywords":["topological","sort","sorting","graphs","graph","dependency","list","dependencies","acyclic"],"author":"","license":"MIT","_id":"toposort-class@0.1.2","dist":{"shasum":"c4ab502197a42ab39fe19cd6ded49f788582b405","tarball":"https://registry.npmjs.org/toposort-class/-/toposort-class-0.1.2.tgz","integrity":"sha512-MuOpuSNz/ZhMqUA+7aF4PdQXBmOMDP5K5isjx+bmifkG8xv30OaUQAO7P9jpyLrb7L1Y39nAV8545PnwL0DtpA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCl9W6DKv+Hjh6IclF+TNq1OMagwAFPKaxUWWud6HiASwIgfzrXfALla+phv32RkzdM5lELTmxhOpaWqgoZjcz/4BU="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"gustavohenke","email":"gustavo@injoin.com.br"},"maintainers":[{"name":"gustavohenke","email":"gustavo@injoin.com.br"}],"directories":{}},"0.1.3":{"name":"toposort-class","version":"0.1.3","description":"Topological sort of directed acyclic graphs (like dependecy lists)","main":"index.js","devDependencies":{"vows":"*"},"scripts":{"test":"vows --spec test.js"},"repository":{"type":"git","url":"https://github.com/gustavohenke/node-toposort.git"},"keywords":["topological","sort","sorting","graphs","graph","dependency","list","dependencies","acyclic"],"author":"","license":"MIT","_id":"toposort-class@0.1.3","dist":{"shasum":"b2437bbb3494485b92477e969248c7a5f2bdd733","tarball":"https://registry.npmjs.org/toposort-class/-/toposort-class-0.1.3.tgz","integrity":"sha512-hBpZD+p6TP1plrz+ZeGpi3knvKFlaytJ2MynXcyXVbEpyj8HSWXOjEQX3kexyJA8ovepslj9TtH46qnFBdeDGA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtXZBvqyH+4KVrvKpaoWxyPp6WxU/9Hw1E5DenSqEvKAIgetICL+fjzI3iTsO4U9gaAtLJkPwoN3R5ukpiguD1AAU="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"gustavohenke","email":"gustavo@injoin.com.br"},"maintainers":[{"name":"gustavohenke","email":"gustavo@injoin.com.br"}],"directories":{},"deprecated":"Items would not be added if empty dependencies array is passed. Use a newer version instead."},"0.1.4":{"name":"toposort-class","version":"0.1.4","description":"Topological sort of directed acyclic graphs (like dependecy lists)","main":"index.js","devDependencies":{"vows":"*"},"scripts":{"test":"vows --spec test.js"},"repository":{"type":"git","url":"https://github.com/gustavohenke/node-toposort.git"},"keywords":["topological","sort","sorting","graphs","graph","dependency","list","dependencies","acyclic"],"author":"","license":"MIT","_id":"toposort-class@0.1.4","dist":{"shasum":"907c3d8f9d5d5e4d07586f202e25771606590a1a","tarball":"https://registry.npmjs.org/toposort-class/-/toposort-class-0.1.4.tgz","integrity":"sha512-OlP2XSdeI7mlymDNH/7NeXz6CLXea6OHfwCuC3uK0h0+a3JtJ3WG7fxyyHS+31b+sOAEobWf1K5S575zMzmMDw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG5nPBQ0kQBNl+qqMCcAs6Yzbat4Wwa0TjANNcOhF6Z4AiEAmeUhER8roKNICgx/niknE5nbxMmrNGWw8RPIhdZusy0="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"gustavohenke","email":"gustavo@injoin.com.br"},"maintainers":[{"name":"gustavohenke","email":"gustavo@injoin.com.br"}]},"0.2.0":{"name":"toposort-class","version":"0.2.0","description":"Topological sort of directed acyclic graphs (like dependecy lists)","main":"./toposort.js","devDependencies":{"mocha":"~1.12.x","chai":"~1.7.x"},"scripts":{"test":"mocha","pretest":"node browser-test-setup.js"},"repository":{"type":"git","url":"https://github.com/gustavohenke/toposort.git"},"keywords":["topological","sort","sorting","graphs","graph","dependency","list","dependencies","acyclic"],"author":"","license":"MIT","bugs":{"url":"https://github.com/gustavohenke/toposort/issues"},"_id":"toposort-class@0.2.0","dist":{"shasum":"df18cb2259b688cbdffcf92e58f0af39e002c571","tarball":"https://registry.npmjs.org/toposort-class/-/toposort-class-0.2.0.tgz","integrity":"sha512-tzX2kYww4LX7poILkwsfqfk952im3/vTmOlpKidh1YYAm9qeh7YL6QvbSOuNhiXxqJ9Cc4tea19SYPUa5lkmOA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSaQWM2Opd+e5XrCv2PSUSeig1yQs9psgKdnNdmWQHJwIhAPRtYUs9bHy27fDy2cLHYPlxSGYRYYXU6Z0kJ/ZhGCiR"}]},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"gustavohenke","email":"gustavo@injoin.com.br"},"maintainers":[{"name":"gustavohenke","email":"gustavo@injoin.com.br"}]},"0.2.1":{"name":"toposort-class","version":"0.2.1","description":"Topological sort of directed acyclic graphs (like dependecy lists)","main":"./toposort.js","devDependencies":{"mocha":"~1.12.x","chai":"~1.7.x"},"scripts":{"test":"mocha","pretest":"node scripts/browser-test.js"},"repository":{"type":"git","url":"https://github.com/gustavohenke/toposort.git"},"keywords":["topological","sort","sorting","graphs","graph","dependency","list","dependencies","acyclic","browser"],"author":"","license":"MIT","bugs":{"url":"https://github.com/gustavohenke/toposort/issues"},"_id":"toposort-class@0.2.1","dist":{"shasum":"afd906db6bc62039456187e5310df5ce0df5a0bb","tarball":"https://registry.npmjs.org/toposort-class/-/toposort-class-0.2.1.tgz","integrity":"sha512-QCMRWXz7xhHMDAARtIw207aJh3KVvVBUbhtuhRnCYal3N5nIo7D/l2L/csN9g5GvBoDbAiMZBCXelF8WzV0orQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFu4Et/y8r60VxQeAbaTrvpmLZlC1J5JTeg6irQYzRkzAiAS9mqhGrKAr6mAH5HcVSgnkHgPbbP/nwcat/9AqhUJ0A=="}]},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"gustavohenke","email":"gustavo@injoin.com.br"},"maintainers":[{"name":"gustavohenke","email":"gustavo@injoin.com.br"}]},"0.3.0":{"name":"toposort-class","version":"0.3.0","description":"Topological sort of directed acyclic graphs (like dependecy lists)","main":"./toposort.js","devDependencies":{"requirejs":"~2.1.10","chai":"~1.8.1","grunt":"~0.4.2","grunt-jscs-checker":"~0.3.2","grunt-contrib-jshint":"~0.8.0","grunt-mocha-test":"~0.8.2","grunt-mocha":"~0.4.9"},"scripts":{"test":"grunt"},"repository":{"type":"git","url":"https://github.com/gustavohenke/toposort.git"},"keywords":["topological","sort","sorting","graphs","graph","dependency","list","dependencies","acyclic","browser"],"author":"","license":"MIT","bugs":{"url":"https://github.com/gustavohenke/toposort/issues"},"_id":"toposort-class@0.3.0","dist":{"shasum":"11a3a41278769b25a4f65cedba9da69a2be8581a","tarball":"https://registry.npmjs.org/toposort-class/-/toposort-class-0.3.0.tgz","integrity":"sha512-30ell+axHRgzG4JATos5VT7jbci/NPUyUDZdfN+zLuq9MdEoxh7+5/HMqrncyCCQnG+A6l0kDMhcDn6PZwFiZQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDH6ZgvVLgnExqDgh57UGSw4WdG9oW/HnwBq7E0KjbQxAiEA0XIiwt2seXq/NqK1kF9wnKaIWEMWzWzC8ZqlhiNmBYg="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"gustavohenke","email":"gustavo@injoin.com.br"},"maintainers":[{"name":"gustavohenke","email":"gustavo@injoin.com.br"}]},"0.3.1":{"name":"toposort-class","version":"0.3.1","description":"Topological sort of directed acyclic graphs (like dependecy lists)","main":"./toposort.js","devDependencies":{"requirejs":"~2.1.10","chai":"~1.8.1","grunt":"~0.4.2","grunt-jscs-checker":"~0.4.1","grunt-contrib-jshint":"~0.8.0","grunt-mocha-test":"~0.8.2","grunt-mocha":"~0.4.9"},"scripts":{"test":"grunt"},"repository":{"type":"git","url":"https://github.com/gustavohenke/toposort.git"},"keywords":["topological","sort","sorting","graphs","graph","dependency","list","dependencies","acyclic","browser"],"author":"","license":"MIT","bugs":{"url":"https://github.com/gustavohenke/toposort/issues"},"homepage":"https://github.com/gustavohenke/toposort","_id":"toposort-class@0.3.1","dist":{"shasum":"d1333aed734f8608ced1286218bd2c45f60eff48","tarball":"https://registry.npmjs.org/toposort-class/-/toposort-class-0.3.1.tgz","integrity":"sha512-r8y3rqJ0FlmH+ZpXj3tKDw8fhLqRVH9rUFdal5p29Y/Xg50TM+PIkOPu2P/w/KxHViwfRQKvRdYg7G937TALkg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE9um4XM1cL5M6tFgKYEzCbQ+X8OLhtFJrRILpQHjUCtAiEAjfEofHJdfYSVFh0gC0Kz5V1F+g9aafKL7nKaF/eoZVc="}]},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"gustavohenke","email":"gustavo@injoin.com.br"},"maintainers":[{"name":"gustavohenke","email":"gustavo@injoin.com.br"}]},"1.0.0":{"name":"toposort-class","version":"1.0.0","description":"Topological sort of directed acyclic graphs (like dependecy lists)","main":"./index.js","devDependencies":{"babel-eslint":"^4.0.5","eslint":"^0.24.1","grunt":"^0.4.5","grunt-babel":"^5.0.1","grunt-banner":"^0.4.0","grunt-contrib-clean":"^0.6.0","grunt-contrib-uglify":"^0.9.1","matcha":"^0.6.0","mocha":"^2.2.5"},"scripts":{"test":"mocha -b test","eslint":"eslint src/toposort.js test/spec.js Gruntfile.js","benchmark":"matcha benchmark/general.js","benchmark-save":"matcha -R csv benchmark/general.js > benchmark/results.csv"},"repository":{"type":"git","url":"git+https://github.com/gustavohenke/toposort.git"},"keywords":["topological","sort","sorting","graphs","graph","dependency","list","dependencies","acyclic","browser"],"author":"","license":"MIT","gitHead":"fcb4642302b9d38a962990a092ae73282cdcb5a9","bugs":{"url":"https://github.com/gustavohenke/toposort/issues"},"homepage":"https://github.com/gustavohenke/toposort#readme","_id":"toposort-class@1.0.0","_shasum":"b4d3e5457782d8dbca8274fc454e9f8b49e8def1","_from":".","_npmVersion":"2.13.0","_nodeVersion":"2.3.3","_npmUser":{"name":"gustavohenke","email":"gustavo@injoin.io"},"maintainers":[{"name":"gustavohenke","email":"gustavo@injoin.com.br"}],"dist":{"shasum":"b4d3e5457782d8dbca8274fc454e9f8b49e8def1","tarball":"https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.0.tgz","integrity":"sha512-MrG7E4cwAgSa9pzjbFNxw7xILxPWNcR1ic/l6DBSnhuFGKZrPVYrKNeSMyitzTXvrUBuEtu2XngZld4DdLgyxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCI2g9tj7xoaXr1zJZW//B7bFNqcvfYaPPrp2su5cr3MAIgPISeSZ4anulbv/KA2K2DaYxmsTzZxOqQA11O5IzWIG0="}]}},"1.0.1":{"name":"toposort-class","version":"1.0.1","description":"Topological sort of directed acyclic graphs (like dependecy lists)","main":"./index.js","devDependencies":{"babel-eslint":"^4.0.5","eslint":"^1.0.0","grunt":"^0.4.5","grunt-babel":"^5.0.1","grunt-banner":"^0.4.0","grunt-contrib-clean":"^0.6.0","grunt-contrib-uglify":"^0.9.1","matcha":"^0.6.0","mocha":"^2.2.5"},"scripts":{"test":"mocha -b test","eslint":"eslint src/toposort.js test/spec.js Gruntfile.js","benchmark":"matcha benchmark/general.js","benchmark-save":"matcha -R csv benchmark/general.js > benchmark/results.csv"},"repository":{"type":"git","url":"git+https://github.com/gustavohenke/toposort.git"},"keywords":["topological","sort","sorting","graphs","graph","dependency","list","dependencies","acyclic","browser"],"author":"","license":"MIT","gitHead":"25700cd0d9c6be5b828df1e372a88ac2bb64a581","bugs":{"url":"https://github.com/gustavohenke/toposort/issues"},"homepage":"https://github.com/gustavohenke/toposort#readme","_id":"toposort-class@1.0.1","_shasum":"7ffd1f78c8be28c3ba45cd4e1a3f5ee193bd9988","_from":".","_npmVersion":"2.13.0","_nodeVersion":"2.3.3","_npmUser":{"name":"gustavohenke","email":"gustavo@injoin.io"},"maintainers":[{"name":"gustavohenke","email":"gustavo@injoin.com.br"}],"dist":{"shasum":"7ffd1f78c8be28c3ba45cd4e1a3f5ee193bd9988","tarball":"https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz","integrity":"sha512-OsLcGGbYF3rMjPUf8oKktyvCiUxSbqMMS39m33MAjLTC1DVIH6x3WSt63/M77ihI09+Sdfk1AXvfhCEeUmC7mg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBbMeuFtMbBk/FdbqwA3YCPmfdpENf/F+Xc3savdtZxlAiBGCXWNay8PczPtr7iw4goQxc0HhM0FTtxTehezdmiIwQ=="}]}}},"readme":"# Toposort\n[![Build Status](http://img.shields.io/travis/gustavohenke/toposort.svg?branch=master&style=flat)](https://travis-ci.org/gustavohenke/toposort)\n[![Dependency Status](http://img.shields.io/gemnasium/gustavohenke/toposort.png?style=flat)](https://gemnasium.com/gustavohenke/toposort)\n\n__Sorting directed acyclic graphs, for Node.js, io.js and the browser__\n_This was originally done by Marcel Klehr. [Why not checkout his original repo?](https://github.com/marcelklehr/toposort)_\n\n## Installation\nThere are a few ways for installing Toposort. Here are them:\n\n* Via NPM: `npm install toposort-class`\n* Via Bower: `bower install toposort`\n* Via Git: `git clone git://github.com/gustavohenke/toposort.git`\n* [Direct download](https://raw.githubusercontent.com/gustavohenke/toposort/master/build/toposort.js) ([Minified](https://raw.githubusercontent.com/gustavohenke/toposort/master/build/toposort.min.js)) for use in the browser\n\n## Example\nLet's say you have the following dependency graph:\n\n* Plugin depends on Backbone and jQuery UI Button;\n* Backbone depends on jQuery and Underscore;\n* jQuery UI Button depends on jQuery UI Core and jQuery UI Widget;\n* jQuery UI Widget and jQuery UI Core depend on jQuery;\n* jQuery and Underscore don't depend on anyone.\n\nNow, how would you sort this in a way that each asset will be correctly placed? You'll probably need the following sorting:\n\n* `jQuery`, `jQuery UI Core`, `jQuery UI Widget`, `jQuery UI Button`, `Underscore`, `Backbone`, `Plugin`\n\nYou can achieve it with the following code, using `toposort-class`:\n```javascript\nvar Toposort = require('toposort-class'),\n\tt = new Toposort();\n\nt.add(\"jquery-ui-core\", \"jquery\")\n .add(\"jquery-ui-widget\", \"jquery\")\n .add(\"jquery-ui-button\", [\"jquery-ui-core\", \"jquery-ui-widget\"])\n .add(\"plugin\", [\"backbone\", \"jquery-ui-button\"])\n .add(\"backbone\", [\"underscore\", \"jquery\"]);\n\nconsole.log(t.sort().reverse());\n\n/* Will output:\n * ['jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-button', 'underscore', 'backbone', 'plugin']\n *\n * And you're done.\n */\n```\n\n## Usage\nCommonJS (Node.js and io.js):\n```javascript\nvar Toposort = require('toposort-class'),\n\tt = new Toposort();\n```\n\nBrowser with AMD:\n```javascript\ndefine(\"myModule\", [\"Toposort\"], function(Toposort) {\n    var t = new Toposort();\n});\n```\n\nBrowser without AMD:\n```javascript\nvar t = new window.Toposort();\n```\n\nor whatever global object there is instead of `window`.\n\n## API\n\n#### `.add(item, deps)`\n* _{String}_ `item` - The name of the dependent item that is being added\n* _{Array|String}_ `deps` - A dependency or list of dependencies of `item`\n\n__Returns:__ _{Toposort}_ The Toposort instance, for chaining.\n\n#### `.sort()`\n__Returns:__ _{Array}_ The list of dependencies topologically sorted.\n\nThis method will check for cyclic dependencies, like \"A is dependent of A\".\n\n#### `.clear()`\n__Returns:__ _{Toposort}_ The Toposort instance, for chaining.\n\nClears all edges, effectively resetting the instance.\n\n#### `.Toposort`\n\nReference to the Toposort constructor.\n\n## Legal\nMIT License\n","maintainers":[{"name":"gustavohenke","email":"gustavo@injoin.com.br"}],"time":{"modified":"2022-06-27T18:42:11.294Z","created":"2013-01-03T00:21:23.944Z","0.1.0":"2013-01-03T00:21:27.984Z","0.1.1":"2013-01-17T14:52:06.081Z","0.1.2":"2013-01-17T15:39:45.044Z","0.1.3":"2013-02-05T20:48:35.019Z","0.1.4":"2013-03-29T16:32:41.336Z","0.2.0":"2013-07-02T19:10:45.964Z","0.2.1":"2013-07-23T14:57:53.385Z","0.3.0":"2014-01-20T00:05:26.660Z","0.3.1":"2014-04-29T18:12:31.454Z","1.0.0":"2015-07-31T01:07:15.342Z","1.0.1":"2015-08-13T11:08:15.990Z"},"repository":{"type":"git","url":"git+https://github.com/gustavohenke/toposort.git"},"readmeFilename":"README.md","homepage":"https://github.com/gustavohenke/toposort#readme","keywords":["topological","sort","sorting","graphs","graph","dependency","list","dependencies","acyclic","browser"],"bugs":{"url":"https://github.com/gustavohenke/toposort/issues"},"license":"MIT","users":{"artakvg":true}}