{"name":"sequence","version":"2.1.1","description":"The promise / subscribe / deferred module of FuturesJS (Ender.JS and Node.JS)","homepage":"https://github.com/coolaj86/futures","keywords":["flow-control","async","asynchronous","futures","sequence","chain","step","util","browser"],"repository":{"type":"git","url":"git://github.com/coolaj86/futures.git"},"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"http://coolaj86.info"},"main":"sequence.js","directories":{"lib":"."},"dependencies":{},"engines":{"node":"*","ender":">= 0.5.0"},"_npmJsonOpts":{"file":"/Users/coolaj86/.npm/sequence/2.1.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"sequence@2.1.1","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"f3cf586c20ac0434e2b54c87640e1e39ab650d0a","tarball":"http://registry-npm.ywwl.com/sequence/download/sequence-2.1.1.tgz","integrity":"sha512-PWTSxX/TPA1Wn64uy5nHf9c+DdlwOquK1BD17XnDqhI+89T8M3cEFn8mW2QUYMWjCpfFPfMPeVUtUDzgnm4qCA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGZcTbCRBRRpN/ppaGghK1I9mmEkn+Kbl/braaSNEahQAiEAop4yt8CACidd/4GgDsE5wlSdmAwsoiif8HUh3oFR7Us="}],"size":1093,"noattachment":false,"key":"/sequence/-/sequence-2.1.1.tgz"},"scripts":{},"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":1310588827501,"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_cnpm_publish_time":1310588827501,"dist-tags":{"latest":"3.0.0"}}