{"_id":"sebastian","_rev":"41-9a166f21f0a39d95847967e7e3920acd","name":"sebastian","dist-tags":{"latest":"0.2.5"},"versions":{"0.0.1":{"name":"sebastian","version":"0.0.1","scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"_id":"sebastian@0.0.1","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-beta-10","_nodeVersion":"v0.6.7","_defaultsLoaded":true,"dist":{"shasum":"b8438a4d63419657cab353d8668771897a6fac1e","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.0.1.tgz","integrity":"sha512-7dFpGZTzEgMI3c7DKHcYbH02SO20+EoQ5k5RKf5PnqRLLZIeOkdUG0qbsGKmj/PW1WE+WNkfsy7wiktb1PcZZQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAQAMI8jKgrV483bJiqgSNQZgSSxF/BoBzS/DF5HryPiAiEA9ii+oDiP8kGvEMTZDKHKtTX0FUNX0NecKFGnFe7RurI="}]},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]},"0.0.2":{"name":"sebastian","version":"0.0.2","scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"_id":"sebastian@0.0.2","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-beta-10","_nodeVersion":"v0.6.7","_defaultsLoaded":true,"dist":{"shasum":"bac0326cc5834d903afa49d2af3c72fa6055cb84","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.0.2.tgz","integrity":"sha512-bsqTutIl28JYzNRSY9PQtBni6glDxjXDKCqpLNevL9IyAoKXPe06lZL1N/HjFcHCZdDtAuIQ9nvyAhyQ/aEr4g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB6MNuAdyGxqQcQAQS/YPIuZhmfVgSkMfEu4I+9WirJ5AiEA4JsiWcP9MEsqzUs6be1DDfxv/f9EWp+0FbfLE4ltWxE="}]},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]},"0.0.3":{"name":"sebastian","version":"0.0.3","keywords":["sebastian","flow-control","flow","deferred","promise"],"author":{"name":"Mandarin Drummond","url":"http://mandarindrummond.com"},"scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"_id":"sebastian@0.0.3","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-beta-10","_nodeVersion":"v0.6.7","_defaultsLoaded":true,"dist":{"shasum":"7a464e2142896d861b07a2f5aa6bd4b6aaf4c0aa","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.0.3.tgz","integrity":"sha512-WPgFHQgVYtiLjO5+oFtPIW9Bi20sch1MEYlYsKbnfGV5UCnRS4kTA7sHm2igso2U8Dvy6Nasa18wqh3suq3Jhw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGdZZ80PlkAsx19/Qv4tAqOxwtIB9UN7NoOf5E9XN3taAiEA2HliPiRtqmplLGJST8BAnoZS5jZp/cwr+xQYDwnuF9Q="}]},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]},"0.1.1":{"name":"sebastian","version":"0.1.1","keywords":["sebastian","flow-control","flow","deferred","promise"],"author":{"name":"Mandarin Drummond","url":"http://mandarindrummond.com"},"scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"readme":"# Sebastian\n\n##Intro\n\nSebastian is a flow control library aimed at encouraging developers to write organized, testable code. It works in the browser\nor with Node.js.\n\n## Rationale\n\nThere are many flow-control libraries out there, but none that I am quite satisfied with at the moment. [Async](https://github.com/caolan/async)\nis great, but I don't agree with Node.js-style callback conventions and I don't like mixing success and error condition\nlogic. Also, I have found Async-wrapped code to be difficult to test. Sebastian is built to encourage construction of discrete chunks\nof manageable code that can be easily tested. I'm a big fan of Deferreds. Sebastian uses jQuery Deferred $.when() wrapper\nto treat asynchronous and synchronous steps/code the same.\n\n## Dependencies\n\n* For Node.js, [jquery-deferred](https://github.com/zzdhidden/node-jquery-deferred), but Q support may be added at a later date.\n* For browser environments, jQuery.\n\n## Getting started\n\n### To use as a Node.js module, install with NPM, or add as a dependency in your package.json.\n\n```\nnpm install sebastian\n```\n\nThen, require the module and add a flow:\n\n```\nvar flow = require(\"sebastian\").flow;\n\nflow(\"helloFlow\")\n    .step(\"one\", function() {\n        console.log(\"hello..\");\n    }).step(\"two\", function() {\n        console.log(\"hello 2..\");\n    }).begin();\n```\n\nThis creates a flow called \"helloFlow\", adds to steps two the flow, and starts the flow.\n\n### To use with an AMD module loader (only tested w/ RequireJS):\n\n```\n    require([\"jquery\", \"path/to/sebastian\"], function($, sebastian) {\n\n        //call the local definition\n        sebastian.flow(\"blah\")\n                .step(\"one\", function() {\n                    console.log(\"step one..\");\n                })\n                .step(\"two\", function() {\n                    console.log(\"step two..\");\n                })\n                .begin();\n\n    });\n```\n\n### To use with old-school sequential script tags:\n\n```\n<script type=\"text/javascript\" src=\"vendor/jquery/jquery.min.js\"></script>\n<script type=\"text/javascript\" src=\"/sebastian.js\"></script>\n\n<script type=\"text/javascript\">\n\n    $.Flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            }).begin();\n\n\n</script>\n\n```\n\n## Tests/Specs\n\n* [Tests](test/index.js)\n* [Specs](test/spec.md)\n\n## Examples\n\nTo see all examples (Node.js) go [here](examples/node/)\n\n### To execute units of code sequentially:\n\nWhen flow is executed sequentially, result from each step is passed on to the next step.\n\n```\n    flow(\"mockAsyncFlow\")\n            .step(\"one\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 1...\");\n                    deferred.resolve();\n                }, 301);\n\n                return deferred;\n\n            })\n            .step(\"two\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 2...\");\n                    deferred.resolve();\n                }, 200);\n\n                return deferred;\n            })\n            .step(\"three\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 3...\");\n                    deferred.resolve();\n                }, 100);\n\n                return deferred;\n            })\n            .begin();\n\n```\n\n### To execute units of code in parallel:\n\n```\n    flow(\"mockAsyncFlow\")\n            .step(\"one\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 1...\");\n                    deferred.resolve();\n                }, 301);\n\n                return deferred;\n\n            })\n            .step(\"two\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 2...\");\n                    deferred.resolve();\n                }, 200);\n\n                return deferred;\n            })\n            .step(\"three\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 3...\");\n                    deferred.resolve();\n                }, 100);\n\n                return deferred;\n            })\n            .parallel()\n            .begin();\n```\n\n### To skip a step in a flow:\n\n```\n\n    flow(\"someFlow\")\n        .step(\"one\", function() {\n            console.log(\"one..\");\n        })\n        .step(\"two\", function() {\n            console.log(\"two..\");\n        })\n        .step(\"three\", function() {\n            console.log(\"three..\");\n        });\n\n    flow(\"someFlow\")\n        .skip(\"one\")\n        .begin();\n\n```\n\n### To skip more than one step in a flow:\n\n```\n    flow(\"someFlow\")\n            .step(\"one\", function() {\n                console.log(\"one..\");\n            })\n            .step(\"two\", function() {\n                console.log(\"two..\");\n            })\n            .step(\"three\", function() {\n                console.log(\"three..\");\n            });\n\n    flow(\"someFlow\")\n        .skip(\"one\")\n        .skip(\"two\")\n        .begin();\n\n```\n\n### To start a flow on a specific step:\n```\n    flow(\"someFlow\")\n            .step(\"one\", function() {\n                console.log(\"one..);\n            })\n            .step(\"two\", function() {\n                console.log(\"two..);\n            })\n            .step(\"three\", function() {\n                console.log(\"three..);\n            });\n\n    flow(\"someFlow\")\n        .startOn(\"two\")\n        .begin();\n\n```\n\n### To direct flow to another flow when failure occurs:\n\n```\n    flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            });\n\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n                return $.Deferred().reject(\"blah\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on failure\");\n    flow(\"secondFlow\").onFailure().jumpTo(\"firstFlow\").begin();\n\n```\n\n### To direct flow to another flow when specific failure occurs:\n\n```\n    flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            });\n\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n                return $.Deferred().reject(\"blah\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on failure 'blah'\");\n    flow(\"secondFlow\").onFailure(\"blah\").jumpTo(\"firstFlow\").begin();\n\n```\n\n### To direct flow to another flow when success occurs:\n\n```\n    flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            });\n\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on success\");\n    flow(\"secondFlow\").onSuccess().jumpTo(\"firstFlow\").begin();\n\n```\n\n### To to add error handler for specific error:\n\n```\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n                return $.Deferred().reject(\"blah\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on failure 'blah'\");\n    flow(\"secondFlow\")\n        .onFailure(\"blah\")\n        .handleWith(function() {\n                console.log(\"it failed!\");\n            }).begin();\n\n```\n\n### To access a previously defined flow:\n\n```\n\n    flow(\"someFlow\").step(\"one\", function() {});\n\n    var someFlow = flow(\"someFlow\");\n\n    someFlow.begin();\n\n```\n\n\n### To access a step (useful when unit testing):\n\n```\n    flow(\"someFlow\").step(\"one\", function() {});\n\n    var someFlow = flow(\"someFlow\");\n\n    var step = someFlow.step(\"one\");\n\n    var name = step.name; //the step name\n    var callback = step.callback; //the actual step function/logic\n\n```\n\n\n\n\n\n\n\n\n\n","readmeFilename":"README.md","_id":"sebastian@0.1.1","description":"##Intro","dist":{"shasum":"7699dac84ad5b8562723740c2c49c9c0376c794e","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.1.1.tgz","integrity":"sha512-wXAUjlSK4zd6iDWDurkH3jqTj3is0Y0c4b3wwtPCEVEErS7PACOEZsutMGuPJOvP8rHMJS6+4ONrBcHLdPuTRg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7LHuJH6CTIvS+B8m0miV44nfoQvWBRW9Yg+5OEaHAhQIhAN6cAE2i40jNhZ1B4UQ9HUZ0vhkYeKfbFtwLBMLUtFOE"}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]},"0.1.2":{"name":"sebastian","version":"0.1.2","keywords":["sebastian","flow-control","flow","deferred","promise"],"author":{"name":"Mandarin Drummond","url":"http://mandarindrummond.com"},"scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"readme":"# Sebastian\n\n##Intro\n\nSebastian is a flow control library aimed at encouraging developers to write organized, testable code. It works in the browser\nor with Node.js.\n\n## Rationale\n\nThere are many flow-control libraries out there, but none that I am quite satisfied with at the moment. [Async](https://github.com/caolan/async)\nis great, but I don't agree with Node.js-style callback conventions and I don't like mixing success and error condition\nlogic. Also, I have found Async-wrapped code to be difficult to test. Sebastian is built to encourage construction of discrete chunks\nof manageable code that can be easily tested. I'm a big fan of Deferreds. Sebastian uses jQuery Deferred $.when() wrapper\nto treat asynchronous and synchronous steps/code the same.\n\n## Dependencies\n\n* For Node.js, [jquery-deferred](https://github.com/zzdhidden/node-jquery-deferred), but Q support may be added at a later date.\n* For browser environments, jQuery.\n\n## Getting started\n\n### To use as a Node.js module, install with NPM, or add as a dependency in your package.json.\n\n```\nnpm install sebastian\n```\n\nThen, require the module and add a flow:\n\n```\nvar flow = require(\"sebastian\").flow;\n\nflow(\"helloFlow\")\n    .step(\"one\", function() {\n        console.log(\"hello..\");\n    }).step(\"two\", function() {\n        console.log(\"hello 2..\");\n    }).begin();\n```\n\nThis creates a flow called \"helloFlow\", adds to steps two the flow, and starts the flow.\n\n### To use with an AMD module loader (only tested w/ RequireJS):\n\n```\n    require([\"jquery\", \"path/to/sebastian\"], function($, sebastian) {\n\n        //call the local definition\n        sebastian.flow(\"blah\")\n                .step(\"one\", function() {\n                    console.log(\"step one..\");\n                })\n                .step(\"two\", function() {\n                    console.log(\"step two..\");\n                })\n                .begin();\n\n    });\n```\n\n### To use with old-school sequential script tags:\n\n```\n<script type=\"text/javascript\" src=\"vendor/jquery/jquery.min.js\"></script>\n<script type=\"text/javascript\" src=\"/sebastian.js\"></script>\n\n<script type=\"text/javascript\">\n\n    $.Flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            }).begin();\n\n\n</script>\n\n```\n\n## Tests/Specs\n\n* [Tests](test/index.js)\n* [Specs](test/spec.md)\n\n## Examples\n\nTo see all examples (Node.js) go [here](examples/node/)\n\n### To execute units of code sequentially:\n\nWhen flow is executed sequentially, result from each step is passed on to the next step.\n\n```\n    flow(\"mockAsyncFlow\")\n            .step(\"one\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 1...\");\n                    deferred.resolve();\n                }, 301);\n\n                return deferred;\n\n            })\n            .step(\"two\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 2...\");\n                    deferred.resolve();\n                }, 200);\n\n                return deferred;\n            })\n            .step(\"three\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 3...\");\n                    deferred.resolve();\n                }, 100);\n\n                return deferred;\n            })\n            .begin();\n\n```\n\n### To execute units of code in parallel:\n\n```\n    flow(\"mockAsyncFlow\")\n            .step(\"one\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 1...\");\n                    deferred.resolve();\n                }, 301);\n\n                return deferred;\n\n            })\n            .step(\"two\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 2...\");\n                    deferred.resolve();\n                }, 200);\n\n                return deferred;\n            })\n            .step(\"three\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 3...\");\n                    deferred.resolve();\n                }, 100);\n\n                return deferred;\n            })\n            .parallel()\n            .begin();\n```\n\n### To skip a step in a flow:\n\n```\n\n    flow(\"someFlow\")\n        .step(\"one\", function() {\n            console.log(\"one..\");\n        })\n        .step(\"two\", function() {\n            console.log(\"two..\");\n        })\n        .step(\"three\", function() {\n            console.log(\"three..\");\n        });\n\n    flow(\"someFlow\")\n        .skip(\"one\")\n        .begin();\n\n```\n\n### To skip more than one step in a flow:\n\n```\n    flow(\"someFlow\")\n            .step(\"one\", function() {\n                console.log(\"one..\");\n            })\n            .step(\"two\", function() {\n                console.log(\"two..\");\n            })\n            .step(\"three\", function() {\n                console.log(\"three..\");\n            });\n\n    flow(\"someFlow\")\n        .skip(\"one\")\n        .skip(\"two\")\n        .begin();\n\n```\n\n### To start a flow on a specific step:\n```\n    flow(\"someFlow\")\n            .step(\"one\", function() {\n                console.log(\"one..);\n            })\n            .step(\"two\", function() {\n                console.log(\"two..);\n            })\n            .step(\"three\", function() {\n                console.log(\"three..);\n            });\n\n    flow(\"someFlow\")\n        .startOn(\"two\")\n        .begin();\n\n```\n\n### To direct flow to another flow when failure occurs:\n\n```\n    flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            });\n\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n                return $.Deferred().reject(\"blah\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on failure\");\n    flow(\"secondFlow\").onFailure().jumpTo(\"firstFlow\").begin();\n\n```\n\n### To direct flow to another flow when specific failure occurs:\n\n```\n    flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            });\n\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n                return $.Deferred().reject(\"blah\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on failure 'blah'\");\n    flow(\"secondFlow\").onFailure(\"blah\").jumpTo(\"firstFlow\").begin();\n\n```\n\n### To direct flow to another flow when success occurs:\n\n```\n    flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            });\n\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on success\");\n    flow(\"secondFlow\").onSuccess().jumpTo(\"firstFlow\").begin();\n\n```\n\n### To to add error handler for specific error:\n\n```\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n                return $.Deferred().reject(\"blah\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on failure 'blah'\");\n    flow(\"secondFlow\")\n        .onFailure(\"blah\")\n        .handleWith(function() {\n                console.log(\"it failed!\");\n            }).begin();\n\n```\n\n### To access a previously defined flow:\n\n```\n\n    flow(\"someFlow\").step(\"one\", function() {});\n\n    var someFlow = flow(\"someFlow\");\n\n    someFlow.begin();\n\n```\n\n\n### To access a step (useful when unit testing):\n\n```\n    flow(\"someFlow\").step(\"one\", function() {});\n\n    var someFlow = flow(\"someFlow\");\n\n    var step = someFlow.step(\"one\");\n\n    var name = step.name; //the step name\n    var callback = step.callback; //the actual step function/logic\n\n```\n\n\n\n\n\n\n\n\n\n","readmeFilename":"README.md","_id":"sebastian@0.1.2","description":"##Intro","dist":{"shasum":"36cba94dc29498c2d6f8afb916be9c3b39fcf26f","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.1.2.tgz","integrity":"sha512-zvZeqL6jPD7rfxQFtMoMF/l1UBUNH0i/cDeGIGhsDU1RHc9RmnZkdrKvoQU+1qS0KWbPaNu7Alj+VIh6fKgrhg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkb8WjFaNSqxEOV70ans/gueBbsdIs5JaldvsQvKEDdQIhAKO66Rn8x26bhYNwlSFSqDvu+VpaR0cz2hGSXYtdD5cW"}]},"_from":"sebastian/","_npmVersion":"1.2.2","_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]},"0.1.3":{"name":"sebastian","version":"0.1.3","keywords":["sebastian","flow-control","flow","deferred","promise"],"author":{"name":"Mandarin Drummond","url":"http://mandarindrummond.com"},"scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"readme":"# Sebastian\n\n##Intro\n\nSebastian is a flow control library aimed at encouraging developers to write organized, testable code. It works in the browser\nor with Node.js.\n\n## Rationale\n\nThere are many flow-control libraries out there, but none that I am quite satisfied with at the moment. [Async](https://github.com/caolan/async)\nis great, but I don't agree with Node.js-style callback conventions and I don't like mixing success and error condition\nlogic. Also, I have found Async-wrapped code to be difficult to test. Sebastian is built to encourage construction of discrete chunks\nof manageable code that can be easily tested. I'm a big fan of Deferreds. Sebastian uses jQuery Deferred $.when() wrapper\nto treat asynchronous and synchronous steps/code the same.\n\n## Dependencies\n\n* For Node.js, [jquery-deferred](https://github.com/zzdhidden/node-jquery-deferred), but Q support may be added at a later date.\n* For browser environments, jQuery.\n\n## Getting started\n\n### To use as a Node.js module, install with NPM, or add as a dependency in your package.json.\n\n```\nnpm install sebastian\n```\n\nThen, require the module and add a flow:\n\n```\nvar flow = require(\"sebastian\").flow;\n\nflow(\"helloFlow\")\n    .step(\"one\", function() {\n        console.log(\"hello..\");\n    }).step(\"two\", function() {\n        console.log(\"hello 2..\");\n    }).begin();\n```\n\nThis creates a flow called \"helloFlow\", adds to steps two the flow, and starts the flow.\n\n### To use with an AMD module loader (only tested w/ RequireJS):\n\n```\n    require([\"jquery\", \"path/to/sebastian\"], function($, sebastian) {\n\n        //call the local definition\n        sebastian.flow(\"blah\")\n                .step(\"one\", function() {\n                    console.log(\"step one..\");\n                })\n                .step(\"two\", function() {\n                    console.log(\"step two..\");\n                })\n                .begin();\n\n    });\n```\n\n### To use with old-school sequential script tags:\n\n```\n<script type=\"text/javascript\" src=\"vendor/jquery/jquery.min.js\"></script>\n<script type=\"text/javascript\" src=\"/sebastian.js\"></script>\n\n<script type=\"text/javascript\">\n\n    $.Flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            }).begin();\n\n\n</script>\n\n```\n\n## Tests/Specs\n\n* [Tests](test/index.js)\n* [Specs](test/spec.md)\n\n## Examples\n\nTo see all examples (Node.js) go [here](examples/node/)\n\n### To execute units of code sequentially:\n\nWhen flow is executed sequentially, result from each step is passed on to the next step.\n\n```\n    flow(\"mockAsyncFlow\")\n            .step(\"one\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 1...\");\n                    deferred.resolve();\n                }, 301);\n\n                return deferred;\n\n            })\n            .step(\"two\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 2...\");\n                    deferred.resolve();\n                }, 200);\n\n                return deferred;\n            })\n            .step(\"three\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 3...\");\n                    deferred.resolve();\n                }, 100);\n\n                return deferred;\n            })\n            .begin();\n\n```\n\n### To execute units of code in parallel:\n\n```\n    flow(\"mockAsyncFlow\")\n            .step(\"one\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 1...\");\n                    deferred.resolve();\n                }, 301);\n\n                return deferred;\n\n            })\n            .step(\"two\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 2...\");\n                    deferred.resolve();\n                }, 200);\n\n                return deferred;\n            })\n            .step(\"three\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 3...\");\n                    deferred.resolve();\n                }, 100);\n\n                return deferred;\n            })\n            .parallel()\n            .begin();\n```\n\n### To skip a step in a flow:\n\n```\n\n    flow(\"someFlow\")\n        .step(\"one\", function() {\n            console.log(\"one..\");\n        })\n        .step(\"two\", function() {\n            console.log(\"two..\");\n        })\n        .step(\"three\", function() {\n            console.log(\"three..\");\n        });\n\n    flow(\"someFlow\")\n        .skip(\"one\")\n        .begin();\n\n```\n\n### To skip more than one step in a flow:\n\n```\n    flow(\"someFlow\")\n            .step(\"one\", function() {\n                console.log(\"one..\");\n            })\n            .step(\"two\", function() {\n                console.log(\"two..\");\n            })\n            .step(\"three\", function() {\n                console.log(\"three..\");\n            });\n\n    flow(\"someFlow\")\n        .skip(\"one\")\n        .skip(\"two\")\n        .begin();\n\n```\n\n### To start a flow on a specific step:\n```\n    flow(\"someFlow\")\n            .step(\"one\", function() {\n                console.log(\"one..);\n            })\n            .step(\"two\", function() {\n                console.log(\"two..);\n            })\n            .step(\"three\", function() {\n                console.log(\"three..);\n            });\n\n    flow(\"someFlow\")\n        .startOn(\"two\")\n        .begin();\n\n```\n\n### To direct flow to another flow when failure occurs:\n\n```\n    flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            });\n\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n                return $.Deferred().reject(\"blah\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on failure\");\n    flow(\"secondFlow\").onFailure().jumpTo(\"firstFlow\").begin();\n\n```\n\n### To direct flow to another flow when specific failure occurs:\n\n```\n    flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            });\n\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n                return $.Deferred().reject(\"blah\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on failure 'blah'\");\n    flow(\"secondFlow\").onFailure(\"blah\").jumpTo(\"firstFlow\").begin();\n\n```\n\n### To direct flow to another flow when success occurs:\n\n```\n    flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            });\n\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on success\");\n    flow(\"secondFlow\").onSuccess().jumpTo(\"firstFlow\").begin();\n\n```\n\n### To to add error handler for specific error:\n\n```\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n                return $.Deferred().reject(\"blah\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on failure 'blah'\");\n    flow(\"secondFlow\")\n        .onFailure(\"blah\")\n        .handleWith(function() {\n                console.log(\"it failed!\");\n            }).begin();\n\n```\n\n### To access a previously defined flow:\n\n```\n\n    flow(\"someFlow\").step(\"one\", function() {});\n\n    var someFlow = flow(\"someFlow\");\n\n    someFlow.begin();\n\n```\n\n\n### To access a step (useful when unit testing):\n\n```\n    flow(\"someFlow\").step(\"one\", function() {});\n\n    var someFlow = flow(\"someFlow\");\n\n    var step = someFlow.step(\"one\");\n\n    var name = step.name; //the step name\n    var callback = step.callback; //the actual step function/logic\n\n```\n\n\n\n\n\n\n\n\n\n","readmeFilename":"README.md","_id":"sebastian@0.1.3","description":"##Intro","dist":{"shasum":"c5e89ac759eef48bd3ae022e5d5becaed92833cf","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.1.3.tgz","integrity":"sha512-jZEtMQA1tkKRDD9cFKzH75/QbtdaashVOvtd9+G1vGxqd2Zy7fTSGQs6flr4/yHB6zV60bWZ3k5yqicpOc2QcQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEszWj99+INcr5WtyR/maasbRq49SrrFxoRtjXLA1/Q8AiBaOimp+6wvutle0MyvGqj4nNUCPwnETgCUCq8/cYjRvg=="}]},"_from":"sebastian/","_npmVersion":"1.2.2","_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]},"0.1.4":{"name":"sebastian","version":"0.1.4","keywords":["sebastian","flow-control","flow","deferred","promise"],"author":{"name":"Mandarin Drummond","url":"http://mandarindrummond.com"},"scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"readme":"# Sebastian\n\n##Intro\n\nSebastian is a flow control library aimed at encouraging developers to write organized, testable code. It works in the browser\nor with Node.js.\n\n## Rationale\n\nThere are many flow-control libraries out there, but none that I am quite satisfied with at the moment. [Async](https://github.com/caolan/async)\nis great, but I don't agree with Node.js-style callback conventions and I don't like mixing success and error condition\nlogic. Also, I have found Async-wrapped code to be difficult to test. Sebastian is built to encourage construction of discrete chunks\nof manageable code that can be easily tested. I'm a big fan of Deferreds. Sebastian uses jQuery Deferred $.when() wrapper\nto treat asynchronous and synchronous steps/code the same.\n\n## Dependencies\n\n* For Node.js, [jquery-deferred](https://github.com/zzdhidden/node-jquery-deferred), but Q support may be added at a later date.\n* For browser environments, jQuery.\n\n## Getting started\n\n### To use as a Node.js module, install with NPM, or add as a dependency in your package.json.\n\n```\nnpm install sebastian\n```\n\nThen, require the module and add a flow:\n\n```\nvar flow = require(\"sebastian\").flow;\n\nflow(\"helloFlow\")\n    .step(\"one\", function() {\n        console.log(\"hello..\");\n    }).step(\"two\", function() {\n        console.log(\"hello 2..\");\n    }).begin();\n```\n\nThis creates a flow called \"helloFlow\", adds to steps two the flow, and starts the flow.\n\n### To use with an AMD module loader (only tested w/ RequireJS):\n\n```\n    require([\"jquery\", \"path/to/sebastian\"], function($, sebastian) {\n\n        //call the local definition\n        sebastian.flow(\"blah\")\n                .step(\"one\", function() {\n                    console.log(\"step one..\");\n                })\n                .step(\"two\", function() {\n                    console.log(\"step two..\");\n                })\n                .begin();\n\n    });\n```\n\n### To use with old-school sequential script tags:\n\n```\n<script type=\"text/javascript\" src=\"vendor/jquery/jquery.min.js\"></script>\n<script type=\"text/javascript\" src=\"/sebastian.js\"></script>\n\n<script type=\"text/javascript\">\n\n    $.Flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            }).begin();\n\n\n</script>\n\n```\n\n## Tests/Specs\n\n* [Tests](test/index.js)\n* [Specs](test/spec.md)\n\n## Examples\n\nTo see all examples (Node.js) go [here](examples/node/)\n\n### To execute units of code sequentially:\n\nWhen flow is executed sequentially, result from each step is passed on to the next step.\n\n```\n    flow(\"mockAsyncFlow\")\n            .step(\"one\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 1...\");\n                    deferred.resolve();\n                }, 301);\n\n                return deferred;\n\n            })\n            .step(\"two\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 2...\");\n                    deferred.resolve();\n                }, 200);\n\n                return deferred;\n            })\n            .step(\"three\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 3...\");\n                    deferred.resolve();\n                }, 100);\n\n                return deferred;\n            })\n            .begin();\n\n```\n\n### To execute units of code in parallel:\n\n```\n    flow(\"mockAsyncFlow\")\n            .step(\"one\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 1...\");\n                    deferred.resolve();\n                }, 301);\n\n                return deferred;\n\n            })\n            .step(\"two\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 2...\");\n                    deferred.resolve();\n                }, 200);\n\n                return deferred;\n            })\n            .step(\"three\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 3...\");\n                    deferred.resolve();\n                }, 100);\n\n                return deferred;\n            })\n            .parallel()\n            .begin();\n```\n\n### To skip a step in a flow:\n\n```\n\n    flow(\"someFlow\")\n        .step(\"one\", function() {\n            console.log(\"one..\");\n        })\n        .step(\"two\", function() {\n            console.log(\"two..\");\n        })\n        .step(\"three\", function() {\n            console.log(\"three..\");\n        });\n\n    flow(\"someFlow\")\n        .skip(\"one\")\n        .begin();\n\n```\n\n### To skip more than one step in a flow:\n\n```\n    flow(\"someFlow\")\n            .step(\"one\", function() {\n                console.log(\"one..\");\n            })\n            .step(\"two\", function() {\n                console.log(\"two..\");\n            })\n            .step(\"three\", function() {\n                console.log(\"three..\");\n            });\n\n    flow(\"someFlow\")\n        .skip(\"one\")\n        .skip(\"two\")\n        .begin();\n\n```\n\n### To start a flow on a specific step:\n```\n    flow(\"someFlow\")\n            .step(\"one\", function() {\n                console.log(\"one..);\n            })\n            .step(\"two\", function() {\n                console.log(\"two..);\n            })\n            .step(\"three\", function() {\n                console.log(\"three..);\n            });\n\n    flow(\"someFlow\")\n        .startOn(\"two\")\n        .begin();\n\n```\n\n### To direct flow to another flow when failure occurs:\n\n```\n    flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            });\n\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n                return $.Deferred().reject(\"blah\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on failure\");\n    flow(\"secondFlow\").onFailure().jumpTo(\"firstFlow\").begin();\n\n```\n\n### To direct flow to another flow when specific failure occurs:\n\n```\n    flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            });\n\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n                return $.Deferred().reject(\"blah\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on failure 'blah'\");\n    flow(\"secondFlow\").onFailure(\"blah\").jumpTo(\"firstFlow\").begin();\n\n```\n\n### To direct flow to another flow when success occurs:\n\n```\n    flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            });\n\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on success\");\n    flow(\"secondFlow\").onSuccess().jumpTo(\"firstFlow\").begin();\n\n```\n\n### To to add error handler for specific error:\n\n```\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n                return $.Deferred().reject(\"blah\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on failure 'blah'\");\n    flow(\"secondFlow\")\n        .onFailure(\"blah\")\n        .handleWith(function() {\n                console.log(\"it failed!\");\n            }).begin();\n\n```\n\n### To access a previously defined flow:\n\n```\n\n    flow(\"someFlow\").step(\"one\", function() {});\n\n    var someFlow = flow(\"someFlow\");\n\n    someFlow.begin();\n\n```\n\n\n### To access a step (useful when unit testing):\n\n```\n    flow(\"someFlow\").step(\"one\", function() {});\n\n    var someFlow = flow(\"someFlow\");\n\n    var step = someFlow.step(\"one\");\n\n    var name = step.name; //the step name\n    var callback = step.callback; //the actual step function/logic\n\n```\n\n\n\n\n\n\n\n\n\n","readmeFilename":"README.md","_id":"sebastian@0.1.4","description":"##Intro","dist":{"shasum":"47cc8371362f825fd5cad7748c97d794b4c6ee5f","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.1.4.tgz","integrity":"sha512-PUdBcSYkuAWZ5C8WHW6fBOckZJIaom0mLd69Q4QUwe6l/7H2PCjuo6ioVkvRBpa23GCsHcL5OheeLr7jx78ADA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHMx+IhWpubuNoiOmd8VRzdp/k7xdS4A6Mbif/9ff/iJAiB6Y1UavHsUBIGFUvhSytR3IgErfmj251Mz1IIAtsljxA=="}]},"_from":"sebastian/","_npmVersion":"1.2.2","_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]},"0.1.5":{"name":"sebastian","version":"0.1.5","keywords":["sebastian","flow-control","flow","deferred","promise"],"author":{"name":"Mandarin Drummond","url":"http://mandarindrummond.com"},"scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"readme":"# Sebastian\n\n##Intro\n\nSebastian is a flow control library aimed at encouraging developers to write organized, testable code. It works in the browser\nor with Node.js.\n\n## Rationale\n\nThere are many flow-control libraries out there, but none that I am quite satisfied with at the moment. [Async](https://github.com/caolan/async)\nis great, but I don't agree with Node.js-style callback conventions and I don't like mixing success and error condition\nlogic. Also, I have found Async-wrapped code to be difficult to test. Sebastian is built to encourage construction of discrete chunks\nof manageable code that can be easily tested. I'm a big fan of Deferreds. Sebastian uses jQuery Deferred $.when() wrapper\nto treat asynchronous and synchronous steps/code the same.\n\n## Dependencies\n\n* For Node.js, [jquery-deferred](https://github.com/zzdhidden/node-jquery-deferred), but Q support may be added at a later date.\n* For browser environments, jQuery.\n\n## Getting started\n\n### To use as a Node.js module, install with NPM, or add as a dependency in your package.json.\n\n```\nnpm install sebastian\n```\n\nThen, require the module and add a flow:\n\n```\nvar flow = require(\"sebastian\").flow;\n\nflow(\"helloFlow\")\n    .step(\"one\", function() {\n        console.log(\"hello..\");\n    }).step(\"two\", function() {\n        console.log(\"hello 2..\");\n    }).begin();\n```\n\nThis creates a flow called \"helloFlow\", adds to steps two the flow, and starts the flow.\n\n### To use with an AMD module loader (only tested w/ RequireJS):\n\n```\n    require([\"jquery\", \"path/to/sebastian\"], function($, sebastian) {\n\n        //call the local definition\n        sebastian.flow(\"blah\")\n                .step(\"one\", function() {\n                    console.log(\"step one..\");\n                })\n                .step(\"two\", function() {\n                    console.log(\"step two..\");\n                })\n                .begin();\n\n    });\n```\n\n### To use with old-school sequential script tags:\n\n```\n<script type=\"text/javascript\" src=\"vendor/jquery/jquery.min.js\"></script>\n<script type=\"text/javascript\" src=\"/sebastian.js\"></script>\n\n<script type=\"text/javascript\">\n\n    $.Flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            }).begin();\n\n\n</script>\n\n```\n\n## Tests/Specs\n\n* [Tests](test/index.js)\n* [Specs](test/spec.md)\n\n## Examples\n\nTo see all examples (Node.js) go [here](examples/node/)\n\n### To execute units of code sequentially:\n\nWhen flow is executed sequentially, result from each step is passed on to the next step.\n\n```\n    flow(\"mockAsyncFlow\")\n            .step(\"one\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 1...\");\n                    deferred.resolve();\n                }, 301);\n\n                return deferred;\n\n            })\n            .step(\"two\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 2...\");\n                    deferred.resolve();\n                }, 200);\n\n                return deferred;\n            })\n            .step(\"three\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 3...\");\n                    deferred.resolve();\n                }, 100);\n\n                return deferred;\n            })\n            .begin();\n\n```\n\n### To execute units of code in parallel:\n\n```\n    flow(\"mockAsyncFlow\")\n            .step(\"one\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 1...\");\n                    deferred.resolve();\n                }, 301);\n\n                return deferred;\n\n            })\n            .step(\"two\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 2...\");\n                    deferred.resolve();\n                }, 200);\n\n                return deferred;\n            })\n            .step(\"three\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 3...\");\n                    deferred.resolve();\n                }, 100);\n\n                return deferred;\n            })\n            .parallel()\n            .begin();\n```\n\n### To skip a step in a flow:\n\n```\n\n    flow(\"someFlow\")\n        .step(\"one\", function() {\n            console.log(\"one..\");\n        })\n        .step(\"two\", function() {\n            console.log(\"two..\");\n        })\n        .step(\"three\", function() {\n            console.log(\"three..\");\n        });\n\n    flow(\"someFlow\")\n        .skip(\"one\")\n        .begin();\n\n```\n\n### To skip more than one step in a flow:\n\n```\n    flow(\"someFlow\")\n            .step(\"one\", function() {\n                console.log(\"one..\");\n            })\n            .step(\"two\", function() {\n                console.log(\"two..\");\n            })\n            .step(\"three\", function() {\n                console.log(\"three..\");\n            });\n\n    flow(\"someFlow\")\n        .skip(\"one\")\n        .skip(\"two\")\n        .begin();\n\n```\n\n### To start a flow on a specific step:\n```\n    flow(\"someFlow\")\n            .step(\"one\", function() {\n                console.log(\"one..);\n            })\n            .step(\"two\", function() {\n                console.log(\"two..);\n            })\n            .step(\"three\", function() {\n                console.log(\"three..);\n            });\n\n    flow(\"someFlow\")\n        .startOn(\"two\")\n        .begin();\n\n```\n\n### To direct flow to another flow when failure occurs:\n\n```\n    flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            });\n\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n                return $.Deferred().reject(\"blah\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on failure\");\n    flow(\"secondFlow\").onFailure().jumpTo(\"firstFlow\").begin();\n\n```\n\n### To direct flow to another flow when specific failure occurs:\n\n```\n    flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            });\n\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n                return $.Deferred().reject(\"blah\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on failure 'blah'\");\n    flow(\"secondFlow\").onFailure(\"blah\").jumpTo(\"firstFlow\").begin();\n\n```\n\n### To direct flow to another flow when success occurs:\n\n```\n    flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            });\n\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on success\");\n    flow(\"secondFlow\").onSuccess().jumpTo(\"firstFlow\").begin();\n\n```\n\n### To to add error handler for specific error:\n\n```\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n                return $.Deferred().reject(\"blah\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on failure 'blah'\");\n    flow(\"secondFlow\")\n        .onFailure(\"blah\")\n        .handleWith(function() {\n                console.log(\"it failed!\");\n            }).begin();\n\n```\n\n### To access a previously defined flow:\n\n```\n\n    flow(\"someFlow\").step(\"one\", function() {});\n\n    var someFlow = flow(\"someFlow\");\n\n    someFlow.begin();\n\n```\n\n\n### To access a step (useful when unit testing):\n\n```\n    flow(\"someFlow\").step(\"one\", function() {});\n\n    var someFlow = flow(\"someFlow\");\n\n    var step = someFlow.step(\"one\");\n\n    var name = step.name; //the step name\n    var callback = step.callback; //the actual step function/logic\n\n```\n\n\n\n\n\n\n\n\n\n","readmeFilename":"README.md","_id":"sebastian@0.1.5","description":"##Intro","dist":{"shasum":"edef8773e820cc08c4aea705df8cb3754f76a14d","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.1.5.tgz","integrity":"sha512-D7VN2hMtU8SXUNQmS4Y3GZgdBFEYeufIrv2dRtrpUVDgBPc3fHU/IzCj51uwJ6JhiQ8E+/D+UFA//3m5+teGYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEeWYHhM7Na2XFHzwUwvvkEzXqGF3t74G1h5RxgXbkHAIgb3HPM2CuDCC9duYayshppMUsKwI9rb2VEq+m3fGDSWA="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]},"0.1.7":{"name":"sebastian","version":"0.1.7","description":"A flow-control library aimed at encouraging organized, testable code.","keywords":["sebastian","flow-control","flow","deferred","promise"],"author":{"name":"Mandarin Drummond","url":"http://mandarindrummond.com"},"scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"readme":"# Sebastian\n\n##Intro\n\nSebastian is a flow control library aimed at encouraging developers to write organized, testable code. It works in the browser\nor with Node.js.\n\n## Rationale\n\nThere are many flow-control libraries out there, but none that I am quite satisfied with at the moment. [Async](https://github.com/caolan/async)\nis great, but I don't agree with Node.js-style callback conventions and I don't like mixing success and error condition\nlogic. Also, I have found Async-wrapped code to be difficult to test. Sebastian is built to encourage construction of discrete chunks\nof manageable code that can be easily tested. I'm a big fan of Deferreds. Sebastian uses jQuery Deferred $.when() wrapper\nto treat asynchronous and synchronous steps/code the same.\n\n## Dependencies\n\n* For Node.js, [jquery-deferred](https://github.com/zzdhidden/node-jquery-deferred), but Q support may be added at a later date.\n* For browser environments, jQuery.\n\n## Documentation\n\nFor full documentation, check out the [Sebastian GitHub page](http://mandarinconlabarba.github.com/sebastian/).\n\n## Getting started\n\n### To use as a Node.js module, install with NPM, or add as a dependency in your package.json.\n\n```\nnpm install sebastian\n```\n\nThen, require the module and add a flow:\n\n```\nvar flow = require(\"sebastian\").flow;\n\nflow(\"helloFlow\")\n    .step(\"one\", function() {\n        console.log(\"hello..\");\n    }).step(\"two\", function() {\n        console.log(\"hello 2..\");\n    }).begin();\n```\n\nThis creates a flow called \"helloFlow\", adds to steps two the flow, and starts the flow.\n\n### To use with an AMD module loader (only tested w/ RequireJS):\n\n```\n    require([\"jquery\", \"path/to/sebastian\"], function($, sebastian) {\n\n        //call the local definition\n        sebastian.flow(\"blah\")\n                .step(\"one\", function() {\n                    console.log(\"step one..\");\n                })\n                .step(\"two\", function() {\n                    console.log(\"step two..\");\n                })\n                .begin();\n\n    });\n```\n\n### To use with old-school sequential script tags:\n\n```\n<script type=\"text/javascript\" src=\"vendor/jquery/jquery.min.js\"></script>\n<script type=\"text/javascript\" src=\"/sebastian.js\"></script>\n\n<script type=\"text/javascript\">\n\n    $.Flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            }).begin();\n\n\n</script>\n\n```\n\n## Tests/Specs\n\n* [Tests](test/index.js)\n* [Specs](test/spec.md)\n","readmeFilename":"README.md","_id":"sebastian@0.1.7","dist":{"shasum":"17400d7b54d09a9c01c819f311575e6519ed0d9b","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.1.7.tgz","integrity":"sha512-aRA8ExYwYK2/DmpmK/tdgNauXRdkVNk/48JEKpGCmgtcdQ+p9lhSQjJ2wMf/zR5XWfbr/YrKZWiwwuk+nP8Ycg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHV3mrSbSnKoYUHIZa0yJ9U6svg17mcSMi8xApKoGYtBAiBNfKtBF2Ws7B8dWXYf/DXgaIJALirjN1thH0/EtNwNGg=="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]},"0.1.8":{"name":"sebastian","version":"0.1.8","description":"A flow-control library aimed at encouraging organized, testable code.","keywords":["sebastian","flow-control","flow","deferred","promise"],"author":{"name":"Mandarin Drummond","url":"http://mandarindrummond.com"},"scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"readme":"# Sebastian\n\n##Intro\n\nSebastian is a flow control library aimed at encouraging developers to write organized, testable code. It works in the browser\nor with Node.js.\n\n## Rationale\n\nThere are many flow-control libraries out there, but none that I am quite satisfied with at the moment. [Async](https://github.com/caolan/async)\nis great, but I don't agree with Node.js-style callback conventions and I don't like mixing success and error condition\nlogic. Also, I have found Async-wrapped code to be difficult to test. Sebastian is built to encourage construction of discrete chunks\nof manageable code that can be easily tested. I'm a big fan of Deferreds. Sebastian uses jQuery Deferred $.when() wrapper\nto treat asynchronous and synchronous steps/code the same.\n\n## Dependencies\n\n* For Node.js, [jquery-deferred](https://github.com/zzdhidden/node-jquery-deferred), but Q support may be added at a later date.\n* For browser environments, jQuery.\n\n## Documentation\n\nFor full documentation, check out the [Sebastian GitHub page](http://mandarinconlabarba.github.com/sebastian/).\n\n## Getting started\n\n### To use as a Node.js module, install with NPM, or add as a dependency in your package.json.\n\n```\nnpm install sebastian\n```\n\nThen, require the module and add a flow:\n\n```\nvar flow = require(\"sebastian\").flow;\n\nflow(\"helloFlow\")\n    .step(\"one\", function() {\n        console.log(\"hello..\");\n    }).step(\"two\", function() {\n        console.log(\"hello 2..\");\n    }).begin();\n```\n\nThis creates a flow called \"helloFlow\", adds to steps two the flow, and starts the flow.\n\n### To use with an AMD module loader (only tested w/ RequireJS):\n\n```\n    require([\"jquery\", \"path/to/sebastian\"], function($, sebastian) {\n\n        //call the local definition\n        sebastian.flow(\"blah\")\n                .step(\"one\", function() {\n                    console.log(\"step one..\");\n                })\n                .step(\"two\", function() {\n                    console.log(\"step two..\");\n                })\n                .begin();\n\n    });\n```\n\n### To use with old-school sequential script tags:\n\n```\n<script type=\"text/javascript\" src=\"vendor/jquery/jquery.min.js\"></script>\n<script type=\"text/javascript\" src=\"/sebastian.js\"></script>\n\n<script type=\"text/javascript\">\n\n    $.Flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            }).begin();\n\n\n</script>\n\n```\n\n## Tests/Specs\n\n* [Tests](test/index.js)\n* [Specs](test/spec.md)\n","readmeFilename":"README.md","_id":"sebastian@0.1.8","dist":{"shasum":"422b9e2c597fe90877bdebe9f0881c8822c4502b","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.1.8.tgz","integrity":"sha512-Z68+nUmNW+XTSm/w6IHOEfwApcvkzdmmG8+TRGH39lAE11puKdBJ0JVFM5ZE4faRKCxzgnquedbn/ar6CIkDYw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/WGDllXdJlaRMl0hn+HaXF8ELXsWEC2iYVKtilBbKRwIhAIkFc2MBSPvVNh67hUiQivihEh9EMrxz+omBmblNSPUj"}]},"_from":"sebastian/","_npmVersion":"1.2.2","_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]},"0.1.9":{"name":"sebastian","version":"0.1.9","description":"A flow-control library aimed at encouraging organized, testable code.","keywords":["sebastian","flow-control","flow","deferred","promise"],"author":{"name":"Mandarin Drummond","url":"http://mandarindrummond.com"},"scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"readme":"# Sebastian\n\n##Intro\n\nSebastian is a flow control library aimed at encouraging developers to write organized, testable code. It works in the browser\nor with Node.js.\n\n## Rationale\n\nThere are many flow-control libraries out there, but none that I am quite satisfied with at the moment. [Async](https://github.com/caolan/async)\nis great, but I don't agree with Node.js-style callback conventions and I don't like mixing success and error condition\nlogic. Also, I have found Async-wrapped code to be difficult to test. Sebastian is built to encourage construction of discrete chunks\nof manageable code that can be easily tested. I'm a big fan of Deferreds. Sebastian uses jQuery Deferred $.when() wrapper\nto treat asynchronous and synchronous steps/code the same.\n\n## Dependencies\n\n* For Node.js, [jquery-deferred](https://github.com/zzdhidden/node-jquery-deferred), but Q support may be added at a later date.\n* For browser environments, jQuery.\n\n## Documentation\n\nFor full documentation, check out the [Sebastian GitHub page](http://mandarinconlabarba.github.com/sebastian/).\n\n## Getting started\n\n### To use as a Node.js module, install with NPM, or add as a dependency in your package.json.\n\n```\nnpm install sebastian\n```\n\nThen, require the module and add a flow:\n\n```\nvar flow = require(\"sebastian\").flow;\n\nflow(\"helloFlow\")\n    .step(\"one\", function() {\n        console.log(\"hello..\");\n    }).step(\"two\", function() {\n        console.log(\"hello 2..\");\n    }).begin();\n```\n\nThis creates a flow called \"helloFlow\", adds to steps two the flow, and starts the flow.\n\n### To use with an AMD module loader (only tested w/ RequireJS):\n\n```\n    require([\"jquery\", \"path/to/sebastian\"], function($, sebastian) {\n\n        //call the local definition\n        sebastian.flow(\"blah\")\n                .step(\"one\", function() {\n                    console.log(\"step one..\");\n                })\n                .step(\"two\", function() {\n                    console.log(\"step two..\");\n                })\n                .begin();\n\n    });\n```\n\n### To use with old-school sequential script tags:\n\n```\n<script type=\"text/javascript\" src=\"vendor/jquery/jquery.min.js\"></script>\n<script type=\"text/javascript\" src=\"/sebastian.js\"></script>\n\n<script type=\"text/javascript\">\n\n    $.Flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            }).begin();\n\n\n</script>\n\n```\n\n## Tests/Specs\n\n* [Tests](test/index.js)\n* [Specs](test/spec.md)\n","readmeFilename":"README.md","_id":"sebastian@0.1.9","dist":{"shasum":"539d21fa5e1470ea2dac58ed567328a2f530e650","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.1.9.tgz","integrity":"sha512-b1fv0rYjQqfwAuZAtyf3TgttLltax5YFTgakI2ngI/niYs1Z+hchhqed53aa8Pd2bxTDTxwpi6RxyPcPqqqlTg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHWzqLHUNZNuMSzPxb9FNE3nE9s6utkeW532C/eQ048WAiAcXzgYVpSHkYAmpVeVLYYnZB6bwtMdp+ntSGmyFqKD7g=="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]},"0.1.10":{"name":"sebastian","version":"0.1.10","description":"A flow-control library aimed at encouraging organized, testable code.","keywords":["sebastian","flow-control","flow","deferred","promise"],"author":{"name":"Mandarin Drummond","url":"http://mandarindrummond.com"},"scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"readme":"# Sebastian\n\n##Intro\n\nSebastian is a flow control library aimed at encouraging developers to write organized, testable code. It works in the browser\nor with Node.js.\n\n## Rationale\n\nThere are many flow-control libraries out there, but none that I am quite satisfied with at the moment. [Async](https://github.com/caolan/async)\nis great, but I don't agree with Node.js-style callback conventions and I don't like mixing success and error condition\nlogic. Also, I have found Async-wrapped code to be difficult to test. Sebastian is built to encourage construction of discrete chunks\nof manageable code that can be easily tested. I'm a big fan of Deferreds. Sebastian uses jQuery Deferred $.when() wrapper\nto treat asynchronous and synchronous steps/code the same.\n\n## Dependencies\n\n* For Node.js, [jquery-deferred](https://github.com/zzdhidden/node-jquery-deferred), but Q support may be added at a later date.\n* For browser environments, jQuery.\n\n## Documentation\n\nFor full documentation, check out the [Sebastian GitHub page](http://mandarinconlabarba.github.com/sebastian/).\n\n## Getting started\n\n### To use as a Node.js module, install with NPM, or add as a dependency in your package.json.\n\n```\nnpm install sebastian\n```\n\nThen, require the module and add a flow:\n\n```\nvar flow = require(\"sebastian\").flow;\n\nflow(\"helloFlow\")\n    .step(\"one\", function() {\n        console.log(\"hello..\");\n    }).step(\"two\", function() {\n        console.log(\"hello 2..\");\n    }).begin();\n```\n\nThis creates a flow called \"helloFlow\", adds to steps two the flow, and starts the flow.\n\n### To use with an AMD module loader (only tested w/ RequireJS):\n\n```\n    require([\"jquery\", \"path/to/sebastian\"], function($, sebastian) {\n\n        //call the local definition\n        sebastian.flow(\"blah\")\n                .step(\"one\", function() {\n                    console.log(\"step one..\");\n                })\n                .step(\"two\", function() {\n                    console.log(\"step two..\");\n                })\n                .begin();\n\n    });\n```\n\n### To use with old-school sequential script tags:\n\n```\n<script type=\"text/javascript\" src=\"vendor/jquery/jquery.min.js\"></script>\n<script type=\"text/javascript\" src=\"/sebastian.js\"></script>\n\n<script type=\"text/javascript\">\n\n    $.Flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            }).begin();\n\n\n</script>\n\n```\n\n## Tests/Specs\n\n* [Tests](test/index.js)\n* [Specs](test/spec.md)\n","readmeFilename":"README.md","_id":"sebastian@0.1.10","dist":{"shasum":"9ce2fba3422335bbc5b1f2591115ba3be437aaa4","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.1.10.tgz","integrity":"sha512-/5lIxX0weBX1i75HvqR7E6Jb8B/hXDBTHK24SFN+jCjyftCys8X/186dGxSy7PigDtJppIoK3VhOClXT8JM2xQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIENRsQvOYDFhchNB7/9+FGAWHFJiHGJBje5dpfuv1PTWAiBTuIgUkmfO51PO7jxTuLOeYaBMyQSHY3m7D/u8Uqda6A=="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]},"0.1.13":{"name":"sebastian","version":"0.1.13","description":"A flow-control library aimed at encouraging organized, testable code.","keywords":["sebastian","flow-control","flow","deferred","promise"],"author":{"name":"Mandarin Drummond","url":"http://mandarindrummond.com"},"scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"readme":"# Sebastian\n\n##Intro\n\nSebastian is a flow control library aimed at encouraging developers to write organized, testable code. It works in the browser\nor with Node.js.\n\n## Rationale\n\nThere are many flow-control libraries out there, but none that I am quite satisfied with at the moment. [Async](https://github.com/caolan/async)\nis great, but I don't agree with Node.js-style callback conventions and I don't like mixing success and error condition\nlogic. Also, I have found Async-wrapped code to be difficult to test. Sebastian is built to encourage construction of discrete chunks\nof manageable code that can be easily tested. I'm a big fan of Deferreds. Sebastian uses jQuery Deferred $.when() wrapper\nto treat asynchronous and synchronous steps/code the same.\n\n## Dependencies\n\n* For Node.js, [jquery-deferred](https://github.com/zzdhidden/node-jquery-deferred), but Q support may be added at a later date.\n* For browser environments, jQuery.\n\n## Documentation\n\nFor full documentation, check out the [Sebastian GitHub page](http://mandarinconlabarba.github.com/sebastian/).\n\n## Getting started\n\n### To use as a Node.js module, install with NPM, or add as a dependency in your package.json.\n\n```\nnpm install sebastian\n```\n\nThen, require the module and add a flow:\n\n```\nvar flow = require(\"sebastian\").flow;\n\nflow(\"helloFlow\")\n    .step(\"one\", function() {\n        console.log(\"hello..\");\n    }).step(\"two\", function() {\n        console.log(\"hello 2..\");\n    }).begin();\n```\n\nThis creates a flow called \"helloFlow\", adds to steps two the flow, and starts the flow.\n\n### To use with an AMD module loader (only tested w/ RequireJS):\n\n```\n    require([\"jquery\", \"path/to/sebastian\"], function($, sebastian) {\n\n        //call the local definition\n        sebastian.flow(\"blah\")\n                .step(\"one\", function() {\n                    console.log(\"step one..\");\n                })\n                .step(\"two\", function() {\n                    console.log(\"step two..\");\n                })\n                .begin();\n\n    });\n```\n\n### To use with old-school sequential script tags:\n\n```\n<script type=\"text/javascript\" src=\"vendor/jquery/jquery.min.js\"></script>\n<script type=\"text/javascript\" src=\"/sebastian.js\"></script>\n\n<script type=\"text/javascript\">\n\n    $.Flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            }).begin();\n\n\n</script>\n\n```\n\n## Tests/Specs\n\n* [Tests](test/index.js)\n* [Specs](test/spec.md)\n","readmeFilename":"README.md","_id":"sebastian@0.1.13","dist":{"shasum":"92acc3c0ad8503f39cfefc301cc75ffcdb34b391","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.1.13.tgz","integrity":"sha512-Ia4MnlrxT1D1Q4+73VOjw4BEqmV/bqVOUtqqs5ihl8CmXdnUKQZTPFO7tKPinfhBTRkbsEMVNz9meOn/8IgGtA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDy21f4yNRBJ1SBzr42OopgzVuc0pwYygZa7+HGZCYrwIhANkWiu+YiE58aUwqb7OoNHrc5CEbF34HER5HBEUPds1I"}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]},"0.1.14":{"name":"sebastian","version":"0.1.14","description":"A flow-control library aimed at encouraging organized, testable code.","keywords":["sebastian","flow-control","flow","deferred","promise"],"author":{"name":"Mandarin Drummond","url":"http://mandarindrummond.com"},"scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"readme":"# Sebastian\n\n##Intro\n\nSebastian is a flow control library aimed at encouraging developers to write organized, testable code. It works in the browser\nor with Node.js.\n\n## Rationale\n\nThere are many flow-control libraries out there, but none that I am quite satisfied with at the moment. [Async](https://github.com/caolan/async)\nis great, but I don't agree with Node.js-style callback conventions and I don't like mixing success and error condition\nlogic. Also, I have found Async-wrapped code to be difficult to test. Sebastian is built to encourage construction of discrete chunks\nof manageable code that can be easily tested. I'm a big fan of Deferreds. Sebastian uses jQuery Deferred $.when() wrapper\nto treat asynchronous and synchronous steps/code the same.\n\n## Dependencies\n\n* For Node.js, [jquery-deferred](https://github.com/zzdhidden/node-jquery-deferred), but Q support may be added at a later date.\n* For browser environments, jQuery.\n\n## Documentation\n\nFor full documentation, check out the [Sebastian GitHub page](http://mandarinconlabarba.github.com/sebastian/).\n\n## Getting started\n\n### To use as a Node.js module, install with NPM, or add as a dependency in your package.json.\n\n```\nnpm install sebastian\n```\n\nThen, require the module and add a flow:\n\n```\nvar flow = require(\"sebastian\").flow;\n\nflow(\"helloFlow\")\n    .step(\"one\", function() {\n        console.log(\"hello..\");\n    }).step(\"two\", function() {\n        console.log(\"hello 2..\");\n    }).begin();\n```\n\nThis creates a flow called \"helloFlow\", adds to steps two the flow, and starts the flow.\n\n### To use with an AMD module loader (only tested w/ RequireJS):\n\n```\n    require([\"jquery\", \"path/to/sebastian\"], function($, sebastian) {\n\n        //call the local definition\n        sebastian.flow(\"blah\")\n                .step(\"one\", function() {\n                    console.log(\"step one..\");\n                })\n                .step(\"two\", function() {\n                    console.log(\"step two..\");\n                })\n                .begin();\n\n    });\n```\n\n### To use with old-school sequential script tags:\n\n```\n<script type=\"text/javascript\" src=\"vendor/jquery/jquery.min.js\"></script>\n<script type=\"text/javascript\" src=\"/sebastian.js\"></script>\n\n<script type=\"text/javascript\">\n\n    $.Flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            }).begin();\n\n\n</script>\n\n```\n\n## Tests/Specs\n\n* [Tests](test/index.js)\n* [Specs](test/spec.md)\n","readmeFilename":"README.md","_id":"sebastian@0.1.14","dist":{"shasum":"9f87cf45a0dfbdaade7f936c2685d84e073e640f","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.1.14.tgz","integrity":"sha512-W1sjtZ4RBuCS/vvr21g6dOTTCaxw/8ANvYK049tDLHRPtEVPM34FPd1H77VZs7rIGlFV2cpApmNkzF/0llQRJQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKg23q6uC3Djy0p1QgToqAbQ8CHA0kN7PFnh8HbrNDlQIgA7MWWyQ2NhRn4rv05Wj9U2pFH+/N7TB2kcHjsskRjpM="}]},"_from":"sebastian/","_npmVersion":"1.2.2","_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]},"0.2.0":{"name":"sebastian","version":"0.2.0","description":"A flow-control library aimed at encouraging organized, testable code.","keywords":["sebastian","flow-control","flow","deferred","promise"],"author":{"name":"Mandarin Drummond","url":"http://mandarindrummond.com"},"scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"readme":"# Sebastian\n\n##Intro\n\nSebastian is a flow control library aimed at encouraging developers to write organized, testable code. It works in the browser\nor with Node.js.\n\n## Rationale\n\nThere are many flow-control libraries out there, but none that I am quite satisfied with at the moment. [Async](https://github.com/caolan/async)\nis great, but I don't agree with Node.js-style callback conventions and I don't like mixing success and error condition\nlogic. Also, I have found Async-wrapped code to be difficult to test. Sebastian is built to encourage construction of discrete chunks\nof manageable code that can be easily tested. I'm a big fan of Deferreds. Sebastian uses jQuery Deferred $.when() wrapper\nto treat asynchronous and synchronous steps/code the same.\n\n## Dependencies\n\n* For Node.js, [jquery-deferred](https://github.com/zzdhidden/node-jquery-deferred), but Q support may be added at a later date.\n* For browser environments, jQuery.\n\n## Documentation\n\nFor full documentation, check out the [Sebastian GitHub page](http://mandarinconlabarba.github.com/sebastian/).\n\n## Getting started\n\n### To use as a Node.js module, install with NPM, or add as a dependency in your package.json.\n\n```\nnpm install sebastian\n```\n\nThen, require the module and add a flow:\n\n```\nvar flow = require(\"sebastian\").flow;\n\nflow(\"helloFlow\")\n    .step(\"one\", function() {\n        console.log(\"hello..\");\n    }).step(\"two\", function() {\n        console.log(\"hello 2..\");\n    }).begin();\n```\n\nThis creates a flow called \"helloFlow\", adds to steps two the flow, and starts the flow.\n\n### To use with an AMD module loader (only tested w/ RequireJS):\n\n```\n    require([\"jquery\", \"path/to/sebastian\"], function($, sebastian) {\n\n        //call the local definition\n        sebastian.flow(\"blah\")\n                .step(\"one\", function() {\n                    console.log(\"step one..\");\n                })\n                .step(\"two\", function() {\n                    console.log(\"step two..\");\n                })\n                .begin();\n\n    });\n```\n\n### To use with old-school sequential script tags:\n\n```\n<script type=\"text/javascript\" src=\"vendor/jquery/jquery.min.js\"></script>\n<script type=\"text/javascript\" src=\"/sebastian.js\"></script>\n\n<script type=\"text/javascript\">\n\n    $.Flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            }).begin();\n\n\n</script>\n\n```\n\n## Tests/Specs\n\n* [Tests](test/index.js)\n* [Specs](test/spec.md)\n","readmeFilename":"README.md","_id":"sebastian@0.2.0","dist":{"shasum":"43d807c52db0daf1c383a1609c409a8af0286e89","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.2.0.tgz","integrity":"sha512-0Na6gd/JMx5MiGMZBUKKxdBmqwkCwlqw1tJOPg+VFr68L3/RKVv9bedfyzQcrbP13twgTvWfM34jvb9WzINCwg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCt4NASmUYFcdANe3XODSc2J6coMh8YO/puwnNhcWyobgIhAIoOdWRwEsVe8WKuS4bDI0JgExiIZqX56CCkWRg4XKhH"}]},"_from":"sebastian/","_npmVersion":"1.2.2","_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]},"0.2.1":{"name":"sebastian","version":"0.2.1","description":"A flow-control library aimed at encouraging organized, testable code.","keywords":["sebastian","flow-control","flow","deferred","promise"],"author":{"name":"Mandarin Drummond","url":"http://mandarindrummond.com"},"scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"readme":"# Sebastian\n\n##Intro\n\nSebastian is a flow control library aimed at encouraging developers to write organized, testable code. It works in the browser\nor with Node.js.\n\n## Rationale\n\nThere are many flow-control libraries out there, but none that I am quite satisfied with at the moment. [Async](https://github.com/caolan/async)\nis great, but I don't agree with Node.js-style callback conventions and I don't like mixing success and error condition\nlogic. Also, I have found Async-wrapped code to be difficult to test. Sebastian is built to encourage construction of discrete chunks\nof manageable code that can be easily tested. I'm a big fan of Deferreds. Sebastian uses jQuery Deferred $.when() wrapper\nto treat asynchronous and synchronous steps/code the same.\n\n## Dependencies\n\n* For Node.js, [jquery-deferred](https://github.com/zzdhidden/node-jquery-deferred), but Q support may be added at a later date.\n* For browser environments, jQuery.\n\n## Documentation\n\nFor full documentation, check out the [Sebastian GitHub page](http://mandarinconlabarba.github.com/sebastian/).\n\n## Getting started\n\n### To use as a Node.js module, install with NPM, or add as a dependency in your package.json.\n\n```\nnpm install sebastian\n```\n\nThen, require the module and add a flow:\n\n```\nvar flow = require(\"sebastian\").flow;\n\nflow(\"helloFlow\")\n    .step(\"one\", function() {\n        console.log(\"hello..\");\n    }).step(\"two\", function() {\n        console.log(\"hello 2..\");\n    }).begin();\n```\n\nThis creates a flow called \"helloFlow\", adds to steps two the flow, and starts the flow.\n\n### To use with an AMD module loader (only tested w/ RequireJS):\n\n```\n    require([\"jquery\", \"path/to/sebastian\"], function($, sebastian) {\n\n        //call the local definition\n        sebastian.flow(\"blah\")\n                .step(\"one\", function() {\n                    console.log(\"step one..\");\n                })\n                .step(\"two\", function() {\n                    console.log(\"step two..\");\n                })\n                .begin();\n\n    });\n```\n\n### To use with old-school sequential script tags:\n\n```\n<script type=\"text/javascript\" src=\"vendor/jquery/jquery.min.js\"></script>\n<script type=\"text/javascript\" src=\"/sebastian.js\"></script>\n\n<script type=\"text/javascript\">\n\n    $.Flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            }).begin();\n\n\n</script>\n\n```\n\n## Tests/Specs\n\n* [Tests](test/index.js)\n* [Specs](test/spec.md)\n","readmeFilename":"README.md","_id":"sebastian@0.2.1","dist":{"shasum":"303018551716422dbe3cf3ea7ec7730edf5210b8","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.2.1.tgz","integrity":"sha512-qZG+WLVJKOi1N3uHggRgm9jiQJQe+z8LCYYvUcqLJfH60nS3c0X7vGRxWz++slKr5pdIxWEN8rT9NTP+/WNpZA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGUHd3Ib61XRdZTL9/GtNjUKNFDfRqt0UVahUWQbPtQ6AiALPGxAyJOZbeT5suQ9fgsfgsSrgo4CgesNrT1xOVY+pQ=="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]},"0.2.2":{"name":"sebastian","version":"0.2.2","description":"A flow-control library aimed at encouraging organized, testable code.","keywords":["sebastian","flow-control","flow","deferred","promise"],"author":{"name":"Mandarin Drummond","url":"http://mandarindrummond.com"},"scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"readme":"# Sebastian\n\n##Intro\n\nSebastian is a flow control library aimed at encouraging developers to write organized, testable code. It works in the browser\nor with Node.js.\n\n## Rationale\n\nThere are many flow-control libraries out there, but none that I am quite satisfied with at the moment. [Async](https://github.com/caolan/async)\nis great, but I don't agree with Node.js-style callback conventions and I don't like mixing success and error condition\nlogic. Also, I have found Async-wrapped code to be difficult to test. Sebastian is built to encourage construction of discrete chunks\nof manageable code that can be easily tested. I'm a big fan of Deferreds. Sebastian uses jQuery Deferred $.when() wrapper\nto treat asynchronous and synchronous steps/code the same.\n\n## Dependencies\n\n* For Node.js, [jquery-deferred](https://github.com/zzdhidden/node-jquery-deferred), but Q support may be added at a later date.\n* For browser environments, jQuery.\n\n## Documentation\n\nFor full documentation, check out the [Sebastian GitHub page](http://mandarinconlabarba.github.com/sebastian/).\n\n## Getting started\n\n### To use as a Node.js module, install with NPM, or add as a dependency in your package.json.\n\n```\nnpm install sebastian\n```\n\nThen, require the module and add a flow:\n\n```\nvar flow = require(\"sebastian\").flow;\n\nflow(\"helloFlow\")\n    .step(\"one\", function() {\n        console.log(\"hello..\");\n    }).step(\"two\", function() {\n        console.log(\"hello 2..\");\n    }).begin();\n```\n\nThis creates a flow called \"helloFlow\", adds to steps two the flow, and starts the flow.\n\n### To use with an AMD module loader (only tested w/ RequireJS):\n\n```\n    require([\"jquery\", \"path/to/sebastian\"], function($, sebastian) {\n\n        //call the local definition\n        sebastian.flow(\"blah\")\n                .step(\"one\", function() {\n                    console.log(\"step one..\");\n                })\n                .step(\"two\", function() {\n                    console.log(\"step two..\");\n                })\n                .begin();\n\n    });\n```\n\n### To use with old-school sequential script tags:\n\n```\n<script type=\"text/javascript\" src=\"vendor/jquery/jquery.min.js\"></script>\n<script type=\"text/javascript\" src=\"/sebastian.js\"></script>\n\n<script type=\"text/javascript\">\n\n    $.Flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            }).begin();\n\n\n</script>\n\n```\n\n## Tests/Specs\n\n* [Tests](test/index.js)\n* [Specs](test/spec.md)\n","readmeFilename":"README.md","_id":"sebastian@0.2.2","dist":{"shasum":"06b759e47a56603c18c6822c0d7980bbcec2e946","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.2.2.tgz","integrity":"sha512-BlMw2aab/eb/704NRIZ6oR250JV9iQfjlAU8Pwk4PtPo3o9RlVmfbLDbIjJ04BwEJP/cnEsONKj2cPIhQ2fiBg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICYYu0bws6sG14fl5KcAIV847P1sdRYR2LEbjGVTAv4rAiEA15qamGzjjmLSwUNb6AlCqlzwVmwDwGtRHd5l58SFyR4="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]},"0.2.4":{"name":"sebastian","version":"0.2.4","description":"A flow-control library aimed at encouraging organized, testable code.","keywords":["sebastian","flow-control","flow","deferred","promise"],"author":{"name":"Mandarin Drummond","url":"http://mandarindrummond.com"},"scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"readme":"# Sebastian\n\n##Intro\n\nSebastian is a flow control library aimed at encouraging developers to write organized, testable code. It works in the browser\nor with Node.js.\n\n## Rationale\n\nThere are many flow-control libraries out there, but none that I am quite satisfied with at the moment. [Async](https://github.com/caolan/async)\nis great, but I don't agree with Node.js-style callback conventions and I don't like mixing success and error condition\nlogic. Also, I have found Async-wrapped code to be difficult to test. Sebastian is built to encourage construction of discrete chunks\nof manageable code that can be easily tested. I'm a big fan of Deferreds. Sebastian uses jQuery Deferred $.when() wrapper\nto treat asynchronous and synchronous steps/code the same.\n\n## Dependencies\n\n* For Node.js, [jquery-deferred](https://github.com/zzdhidden/node-jquery-deferred), but Q support may be added at a later date.\n* For browser environments, jQuery.\n\n## Documentation\n\nFor full documentation, check out the [Sebastian GitHub page](http://mandarinconlabarba.github.com/sebastian/).\n\n## Getting started\n\n### To use as a Node.js module, install with NPM, or add as a dependency in your package.json.\n\n```\nnpm install sebastian\n```\n\nThen, require the module and add a flow:\n\n```\nvar flow = require(\"sebastian\").flow;\n\nflow(\"helloFlow\")\n    .step(\"one\", function() {\n        console.log(\"hello..\");\n    }).step(\"two\", function() {\n        console.log(\"hello 2..\");\n    }).begin();\n```\n\nThis creates a flow called \"helloFlow\", adds to steps two the flow, and starts the flow.\n\n### To use with an AMD module loader (only tested w/ RequireJS):\n\n```\n    require([\"jquery\", \"path/to/sebastian\"], function($, sebastian) {\n\n        //call the local definition\n        sebastian.flow(\"blah\")\n                .step(\"one\", function() {\n                    console.log(\"step one..\");\n                })\n                .step(\"two\", function() {\n                    console.log(\"step two..\");\n                })\n                .begin();\n\n    });\n```\n\n### To use with old-school sequential script tags:\n\n```\n<script type=\"text/javascript\" src=\"vendor/jquery/jquery.min.js\"></script>\n<script type=\"text/javascript\" src=\"/sebastian.js\"></script>\n\n<script type=\"text/javascript\">\n\n    $.Flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            }).begin();\n\n\n</script>\n\n```\n\n## Tests/Specs\n\n* [Tests](test/index.js)\n* [Specs](test/spec.md)\n","readmeFilename":"README.md","_id":"sebastian@0.2.4","dist":{"shasum":"fd9dea66769beb889cdf4cf1504b40dde52d4558","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.2.4.tgz","integrity":"sha512-L7mCpbmaDYZ3ReXItiULlyxhNrVYGfbwayc4+Xp8TrxHq4QRXzU1pWCRjIWMy9lJd2SJdTUw6ComMDnoG3fdpQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDa9IgNt0v2x1AQqxwsHUC0US4mZJTPPDHmgvTf3HcD7AiEApitk76jp/Tzzt7WH4+I/ez6NBanVoCPu9h0zwLlY2dc="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]},"0.2.5":{"name":"sebastian","version":"0.2.5","description":"A flow-control library aimed at encouraging organized, testable code.","keywords":["sebastian","flow-control","flow","deferred","promise"],"author":{"name":"Mandarin Drummond","url":"http://mandarindrummond.com"},"scripts":{"test":"make test"},"dependencies":{"jquery-deferred":"0.3.0"},"devDependencies":{"mocha":"1.4.2","sinon":"1.3.2","should":"1.1.0","underscore":"1.4.4"},"readme":"# Sebastian\n\n##Intro\n\nSebastian is a flow control library aimed at encouraging developers to write organized, testable code. It works in the browser\nor with Node.js.\n\n## Rationale\n\nThere are many flow-control libraries out there, but none that I am quite satisfied with at the moment. [Async](https://github.com/caolan/async)\nis great, but I don't agree with Node.js-style callback conventions and I don't like mixing success and error condition\nlogic. Also, I have found Async-wrapped code to be difficult to test. Sebastian is built to encourage construction of discrete chunks\nof manageable code that can be easily tested. I'm a big fan of Deferreds. Sebastian uses jQuery Deferred $.when() wrapper\nto treat asynchronous and synchronous steps/code the same.\n\n## Dependencies\n\n* For Node.js, [jquery-deferred](https://github.com/zzdhidden/node-jquery-deferred), but Q support may be added at a later date.\n* For browser environments, jQuery.\n\n## Documentation\n\nFor full documentation, check out the [Sebastian GitHub page](http://mandarinconlabarba.github.com/sebastian/).\n\n## Getting started\n\n### To use as a Node.js module, install with NPM, or add as a dependency in your package.json.\n\n```\nnpm install sebastian\n```\n\nThen, require the module and add a flow:\n\n```\nvar flow = require(\"sebastian\").flow;\n\nflow(\"helloFlow\")\n    .step(\"one\", function() {\n        console.log(\"hello..\");\n    }).step(\"two\", function() {\n        console.log(\"hello 2..\");\n    }).begin();\n```\n\nThis creates a flow called \"helloFlow\", adds to steps two the flow, and starts the flow.\n\n### To use with an AMD module loader (only tested w/ RequireJS):\n\n```\n    require([\"jquery\", \"path/to/sebastian\"], function($, sebastian) {\n\n        //call the local definition\n        sebastian.flow(\"blah\")\n                .step(\"one\", function() {\n                    console.log(\"step one..\");\n                })\n                .step(\"two\", function() {\n                    console.log(\"step two..\");\n                })\n                .begin();\n\n    });\n```\n\n### To use with old-school sequential script tags:\n\n```\n<script type=\"text/javascript\" src=\"vendor/jquery/jquery.min.js\"></script>\n<script type=\"text/javascript\" src=\"/sebastian.js\"></script>\n\n<script type=\"text/javascript\">\n\n    $.Flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            }).begin();\n\n\n</script>\n\n```\n\n## Tests/Specs\n\n* [Tests](test/index.js)\n* [Specs](test/spec.md)\n","readmeFilename":"README.md","_id":"sebastian@0.2.5","dist":{"shasum":"2097993e8e210fe9b0f35f544993cdcff78cd327","tarball":"https://registry.npmjs.org/sebastian/-/sebastian-0.2.5.tgz","integrity":"sha512-MNU3FWPOuolC/lcNgSaaCr1FLeovx05aJ6XYHsuP/Ob8iXpBfR1haxcqD0VC58BXH5LaQe48/tA7j5J+EU/uYw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZ2HnZ/o4mLBOhtVop9wtzFXfZkYeQjj0KkVazTole1QIhAK/nGw1lCCOx3xul+tYRcfw5CLlVXBmzWVpfRWExP8GC"}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"mandarind","email":"mandarind@gmail.com"},"maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}]}},"readme":"# Sebastian\n\n##Intro\n\nSebastian is a flow control library aimed at encouraging developers to write organized, testable code. It works in the browser\nor with Node.js.\n\n## Rationale\n\nThere are many flow-control libraries out there, but none that I am quite satisfied with at the moment. [Async](https://github.com/caolan/async)\nis great, but I don't agree with Node.js-style callback conventions and I don't like mixing success and error condition\nlogic. Also, I have found Async-wrapped code to be difficult to test. Sebastian is built to encourage construction of discrete chunks\nof manageable code that can be easily tested. I'm a big fan of Deferreds. Sebastian uses jQuery Deferred $.when() wrapper\nto treat asynchronous and synchronous steps/code the same.\n\n## Dependencies\n\n* For Node.js, [jquery-deferred](https://github.com/zzdhidden/node-jquery-deferred), but Q support may be added at a later date.\n* For browser environments, jQuery.\n\n## Getting started\n\n### To use as a Node.js module:\n\n```\nvar flow = require(\"sebastian\").flow;\n\nflow(\"helloFlow\")\n    .step(\"one\", function() {\n        console.log(\"hello..\");\n    }).step(\"two\", function() {\n        console.log(\"hello 2..\");\n    }).begin();\n```\n\nThis creates a flow called \"helloFlow\", adds to steps two the flow, and starts the flow.\n\n### To use with an AMD module loader (only tested w/ RequireJS):\n\n```\n    require([\"jquery\", \"path/to/sebastian\"], function($, sebastian) {\n\n        //call the local definition\n        sebastian(\"blah\")\n                .step(\"one\", function() {\n                    console.log(\"step one..\");\n                })\n                .step(\"two\", function() {\n                    console.log(\"step two..\");\n                })\n                .begin();\n\n    });\n```\n\n### To use with old-school sequential script tags:\n\n```\n<script type=\"text/javascript\" src=\"vendor/jquery/jquery.min.js\"></script>\n<script type=\"text/javascript\" src=\"/sebastian.js\"></script>\n\n<script type=\"text/javascript\">\n\n    $.Flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            }).begin();\n\n\n</script>\n\n```\n\n## Tests/Specs\n\n* [Tests](test/index.js)\n* [Specs](test/spec.md)\n\n## Examples\n\nTo see all examples (Node.js) go [here](examples/node/)\n\n### To execute units of code sequentially:\n\nWhen flow is executed sequentially, result from each step is passed on to the next step.\n\n```\n    flow(\"mockAsyncFlow\")\n            .step(\"one\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 1...\");\n                    deferred.resolve();\n                }, 301);\n\n                return deferred;\n\n            })\n            .step(\"two\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 2...\");\n                    deferred.resolve();\n                }, 200);\n\n                return deferred;\n            })\n            .step(\"three\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 3...\");\n                    deferred.resolve();\n                }, 100);\n\n                return deferred;\n            })\n            .begin();\n\n```\n\n### To execute units of code in parallel:\n\n```\n    flow(\"mockAsyncFlow\")\n            .step(\"one\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 1...\");\n                    deferred.resolve();\n                }, 301);\n\n                return deferred;\n\n            })\n            .step(\"two\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 2...\");\n                    deferred.resolve();\n                }, 200);\n\n                return deferred;\n            })\n            .step(\"three\", function() {\n                var deferred = $.Deferred();\n                setTimeout(function() {\n                    console.log(\"step 3...\");\n                    deferred.resolve();\n                }, 100);\n\n                return deferred;\n            })\n            .parallel()\n            .begin();\n```\n\n### To skip a step in a flow:\n\n```\n\n    flow(\"someFlow\")\n        .step(\"one\", function() {\n            console.log(\"one..\");\n        })\n        .step(\"two\", function() {\n            console.log(\"two..\");\n        })\n        .step(\"three\", function() {\n            console.log(\"three..\");\n        });\n\n    flow(\"someFlow\")\n        .skip(\"one\")\n        .begin();\n\n```\n\n### To skip more than one step in a flow:\n\n```\n    flow(\"someFlow\")\n            .step(\"one\", function() {\n                console.log(\"one..\");\n            })\n            .step(\"two\", function() {\n                console.log(\"two..\");\n            })\n            .step(\"three\", function() {\n                console.log(\"three..\");\n            });\n\n    flow(\"someFlow\")\n        .skip(\"one\")\n        .skip(\"two\")\n        .begin();\n\n```\n\n### To start a flow on a specific step:\n```\n    flow(\"someFlow\")\n            .step(\"one\", function() {\n                console.log(\"one..);\n            })\n            .step(\"two\", function() {\n                console.log(\"two..);\n            })\n            .step(\"three\", function() {\n                console.log(\"three..);\n            });\n\n    flow(\"someFlow\")\n        .startOn(\"two\")\n        .begin();\n\n```\n\n### To direct flow to another flow when failure occurs:\n\n```\n    flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            });\n\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n                return $.Deferred().reject(\"blah\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on failure\");\n    flow(\"secondFlow\").onFailure().jumpTo(\"firstFlow\").begin();\n\n```\n\n### To direct flow to another flow when specific failure occurs:\n\n```\n    flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            });\n\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n                return $.Deferred().reject(\"blah\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on failure 'blah'\");\n    flow(\"secondFlow\").onFailure(\"blah\").jumpTo(\"firstFlow\").begin();\n\n```\n\n### To direct flow to another flow when success occurs:\n\n```\n    flow(\"firstFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in firstFlow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in firstFlow...\");\n            });\n\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on success\");\n    flow(\"secondFlow\").onSuccess().jumpTo(\"firstFlow\").begin();\n\n```\n\n### To to add error handler for specific error:\n\n```\n    flow(\"secondFlow\")\n            .step(\"one\", function() {\n                console.log(\"executing step one in second flow...\");\n                return $.Deferred().reject(\"blah\");\n            })\n            .step(\"two\", function() {\n                console.log(\"executing step two in second flow...\");\n            });\n\n\n    console.log(\"beginning flow two, chained to one on failure 'blah'\");\n    flow(\"secondFlow\")\n        .onFailure(\"blah\")\n        .handleWith(function() {\n                console.log(\"it failed!\");\n            }).begin();\n\n```\n\n### To access a previously defined flow:\n\n```\n\n    flow(\"someFlow\").step(\"one\", function() {});\n\n    var someFlow = flow(\"someFlow\");\n\n    someFlow.begin();\n\n```\n\n\n### To access a step (useful when unit testing):\n\n```\n    flow(\"someFlow\").step(\"one\", function() {});\n\n    var someFlow = flow(\"someFlow\");\n\n    var step = someFlow.step(\"one\");\n\n    var name = step.name; //the step name\n    var callback = step.callback; //the actual step function/logic\n\n```\n\n\n\n\n\n\n\n\n\n","maintainers":[{"name":"mandarind","email":"mandarind@gmail.com"}],"time":{"modified":"2022-06-26T17:10:48.322Z","created":"2013-02-13T12:19:21.681Z","0.0.1":"2013-02-13T12:19:22.464Z","0.0.2":"2013-02-13T12:34:02.525Z","0.0.3":"2013-02-14T12:44:10.803Z","0.1.1":"2013-02-22T10:51:35.810Z","0.1.2":"2013-02-26T16:31:34.326Z","0.1.3":"2013-02-26T22:56:02.676Z","0.1.4":"2013-02-26T23:37:50.201Z","0.1.5":"2013-02-28T13:43:53.231Z","0.1.7":"2013-03-01T21:40:26.680Z","0.1.8":"2013-03-06T16:54:37.234Z","0.1.9":"2013-03-08T11:53:19.165Z","0.1.10":"2013-03-10T15:42:50.484Z","0.1.13":"2013-03-12T11:50:37.140Z","0.1.14":"2013-04-04T19:00:09.534Z","0.2.0":"2013-04-05T07:54:44.906Z","0.2.1":"2013-07-29T18:55:09.683Z","0.2.2":"2013-07-31T12:11:34.551Z","0.2.4":"2013-08-23T10:48:54.596Z","0.2.5":"2013-08-26T21:54:46.497Z"},"author":{"name":"Mandarin Drummond","url":"http://mandarindrummond.com"},"description":"A flow-control library aimed at encouraging organized, testable code."}