{"_id":"tsort","_rev":"5-4d7ab6c78baa13dfa3e69ca6d8cdf5c3","name":"tsort","description":"Topological sort on directed graphs.","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"tsort","version":"0.0.1","description":"Topological sort on directed graphs.","main":"index.js","scripts":{"test":"./node_modules/.bin/mocha"},"repository":{"type":"git","url":"git@github.com:eknkc/tsort.git"},"keywords":["dependency","graph","topological","sort","graph"],"devDependencies":{"mocha":"*"},"author":{"name":"Ekin Koc"},"license":"MIT","readme":"# tsort - node.js topological sort utility\n\n    npm install tsort\n\n## usage\n\n```js\nvar tsort = require('tsort');\n\n// create an empty graph\nvar graph = tsort();\n\n// add nodes\ngraph.add('a', 'b');\ngraph.add('b', 'c');\ngraph.add('0', 'a');\n\n// outputs: [ '0', 'a', 'b', 'c' ]\nconsole.dir(graph.sort());\n\n// can add more than one node\ngraph.add('1', '2', '3', 'a');\n// outputs: [ '0', '1', '2', '3', 'a', 'b', 'c' ]\nconsole.dir(graph.sort());\n\n// can add in array form\ngraph.add(['1', '1.5']);\ngraph.add(['1.5', 'a']);\n// outputs: [ '0', '1', '2', '3', '1.5', 'a', 'b', 'c' ]\nconsole.dir(graph.sort());\n\n// detects cycles\ngraph.add('first', 'second');\ngraph.add('second', 'third', 'first');\n// throws: Error: There is a cycle in the graph. It is not possible to derive a topological sort.\ngraph.sort();\n```\n\n#license\nMIT\n","readmeFilename":"README.md","_id":"tsort@0.0.1","dist":{"shasum":"e2280f5e817f8bf4275657fd0f9aebd44f5a2786","tarball":"https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz","integrity":"sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFCysu4pMmCZRQBtkR+e7M231eG9x98W/NTTIvdeekNhAiA79NnviVq15Kfy/LSY5PVB8QRWyAipz6z6EJrPENkOSg=="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"eknkc","email":"ekin@eknkc.com"},"maintainers":[{"name":"eknkc","email":"ekin@eknkc.com"}]}},"readme":"# tsort - node.js topological sort utility\n\n    npm install tsort\n\n## usage\n\n```js\nvar tsort = require('tsort');\n\n// create an empty graph\nvar graph = tsort();\n\n// add nodes\ngraph.add('a', 'b');\ngraph.add('b', 'c');\ngraph.add('0', 'a');\n\n// outputs: [ '0', 'a', 'b', 'c' ]\nconsole.dir(graph.sort());\n\n// can add more than one node\ngraph.add('1', '2', '3', 'a');\n// outputs: [ '0', '1', '2', '3', 'a', 'b', 'c' ]\nconsole.dir(graph.sort());\n\n// can add in array form\ngraph.add(['1', '1.5']);\ngraph.add(['1.5', 'a']);\n// outputs: [ '0', '1', '2', '3', '1.5', 'a', 'b', 'c' ]\nconsole.dir(graph.sort());\n\n// detects cycles\ngraph.add('first', 'second');\ngraph.add('second', 'third', 'first');\n// throws: Error: There is a cycle in the graph. It is not possible to derive a topological sort.\ngraph.sort();\n```\n\n#license\nMIT\n","maintainers":[{"name":"eknkc","email":"ekin@eknkc.com"}],"time":{"modified":"2022-06-27T22:46:07.818Z","created":"2013-02-28T18:00:21.216Z","0.0.1":"2013-02-28T18:00:23.654Z"},"author":{"name":"Ekin Koc"},"repository":{"type":"git","url":"git@github.com:eknkc/tsort.git"}}