{"name":"sequence","version":"3.0.0","description":"Execute async code in chronological order. The sequence module of FuturesJS (Browser, Node.js, Bower, and Pakmanager)","homepage":"https://github.com/FuturesJS/sequence","keywords":["futuresjs","flow-control","async","asynchronous","futures","sequence","chain","step","util","browser"],"repository":{"type":"git","url":"git://github.com/FuturesJS/sequence.git"},"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"http://coolaj86.com"},"main":"sequence.js","directories":{"lib":"."},"dependencies":{},"engines":{"node":"*","ender":">= 0.5.0"},"bugs":{"url":"https://github.com/FuturesJS/sequence/issues"},"_id":"sequence@3.0.0","dist":{"shasum":"5957d3e03c70e270b2009a8c8bdaa97338a6e170","tarball":"http://registry-npm.ywwl.com/sequence/download/sequence-3.0.0.tgz","integrity":"sha512-yWZHN7nRwhS22DLQ9SMt+HSq0fk21PxTpPHF9OrPgPqtvJ6sz0ObDH3e/X/eK1MvfjpRkpjVMZpPMHIc3PWLPQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEH+NxTJEo9FXrS4EqgXPO5m8uTQLmDgYWSRPJwjG3kIAiEAphbwjN+zfB11d8oUkxrnId447zKK+BIURAPz5/PG818="}],"size":5722,"noattachment":false,"key":"/sequence/-/sequence-3.0.0.tgz"},"_from":"./","_npmVersion":"1.3.11","_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"readme":"Sequence\n===\n\nCreates an Asynchronous Stack which execute each enqueued method after the previous function calls the provided `next(err, data [, ...])`.\n\nIn many cases [`forEachAsync`](https://github.com/FuturesJS/forEachAsync) or [`forAllAsync`](https://github.com/FuturesJS/forAllAsync) will be a better alternative.\n\nAPI\n---\n\n  * `Sequence.create(defaultContext=null)`\n  * `then(function callback(next, err, data [, ...]) {}, context)` - add a callback onto the queue\n    * begins or resumes the queue\n    * passes the results of the previous function into the next\n\nNode.js Installation\n---\n\nNode.JS (Server):\n\n```bash\nnpm install sequence\n```\n\nBrowser Installation\n---\n\nYou can install from bower:\n\n```bash\nbower install sequence\n```\n\nOr download the raw file from <https://raw.github.com/FuturesJS/sequence/master/sequence.js>:\n\n```bash\nwget https://raw.github.com/FuturesJS/sequence/master/sequence.js\n```\n\nOr build with pakmanager:\n\n```bash\npakmanager build sequence\n```\n\nUsage\n---\n\n```javascript\n(function (exports) {\n  'use strict';\n\n  var Sequence = exports.Sequence || require('sequence').Sequence\n    , sequence = Sequence.create()\n    , err\n    ;\n\n  sequence\n    .then(function (next) {\n      setTimeout(function () {\n        next(err, \"Hi\", \"World!\");\n      }, 120);\n    })\n    .then(function (next, err, a, b) {\n      setTimeout(function () {\n        next(err, \"Hello\", b);\n      }, 270);\n    })\n    .then(function (next, err, a, b) {\n      setTimeout(function () {\n        console.log(a, b);\n        next();\n      }, 50);\n    });\n\n// so that this example works in browser and node.js\n}('undefined' !== typeof exports && exports || new Function('return this')()));\n```\n","publish_time":1389654659531,"_cnpm_publish_time":1389654659531,"dist-tags":{"latest":"3.0.0"}}