blob: 6e007300467989f605ed753f09cd6a0b68692d82 [file] [log] [blame]
{
"author": {
"name": "Trevor Burnham",
"url": "http://trevorburnham.com"
},
"name": "dep-graph",
"description": "Simple dependency graph management",
"version": "1.1.0",
"homepage": "http://github.com/TrevorBurnham/dep-graph",
"repository": {
"type": "git",
"url": "git://github.com/TrevorBurnham/dep-graph.git"
},
"main": "lib/dep-graph.js",
"dependencies": {
"underscore": "1.2.1"
},
"devDependencies": {
"coffee-script": "1.1.2",
"nodeunit": "0.5.4",
"watchit": ">=0.0.1"
},
"readme": "# dep-graph.js\n\nThis is a small project spun off from [connect-assets](http://github.com/TrevorBurnham/connect-assets). Written in [CoffeeScript](coffeescript.org) by the author of [CoffeeScript: Accelerated JavaScript Development](http://pragprog.com/book/tbcoffee/coffeescript).\n\n## What's it for?\n\nSay you have a set of resources that depend on each other in some way. These resources can be anything—files, chains of command, plot twists on *Lost*—whatever. All that matters is that each one has a unique string identifier, and a list of direct dependencies.\n\n`dep-graph` makes it easy to compute \"chains\" of dependencies, with guaranteed logical ordering and no duplicates. That's trivial in most cases, but if `A` depends on `B` and `B` depends on `A`, a naïve dependency graph would get trapped in an infinite loop. `dep-graph` throws an error if any such \"cycles\" are detected.\n\n## How to use it?\n\n### In the browser\n\n deps = new DepGraph\n deps.add 'A', 'B' # A requires B\n deps.add 'B', 'C' # B requires C\n deps.getChain 'A' # ['C', 'B', 'A']\n\n### In Node.js\n\nSame as above, but first run\n\n npm install dep-graph\n\nfrom your project's directory, and put\n\n DepGraph = require 'dep-graph'\n\nat the top of your file.\n\n## License\n\n©2011 Trevor Burnham and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"readmeFilename": "README.mdown",
"bugs": {
"url": "https://github.com/TrevorBurnham/dep-graph/issues"
},
"_id": "dep-graph@1.1.0",
"_from": "dep-graph@1.1.0"
}