{"_id":"sequence","_rev":"168289","name":"sequence","description":"Execute async code in chronological order. The sequence module of FuturesJS (Browser, Node.js, Bower, and Pakmanager)","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"coolaj86","email":""}],"time":{"modified":"2021-06-03T11:48:52.000Z","created":"2011-07-13T20:27:07.501Z","3.0.0":"2014-01-13T23:10:59.531Z","2.2.1":"2012-05-31T14:08:47.620Z","2.2.0":"2012-05-26T06:47:07.029Z","2.1.1":"2011-07-13T20:27:07.501Z"},"users":{"temasm":true,"erikvold":true,"ngpvnk":true},"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"http://coolaj86.com"},"repository":{"type":"git","url":"git://github.com/FuturesJS/sequence.git"},"versions":{"3.0.0":{"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","size":5722,"noattachment":false,"key":"/sequence/-/sequence-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/sequence/download/sequence-3.0.0.tgz"},"_from":"./","_npmVersion":"1.3.11","_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":""}],"publish_time":1389654659531,"_hasShrinkwrap":false,"_cnpm_publish_time":1389654659531},"2.2.1":{"name":"sequence","version":"2.2.1","description":"The sequence 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"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"_id":"sequence@2.2.1","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"7f5617895d44351c0a047e764467690490a16b03","size":1411,"noattachment":false,"key":"/sequence/-/sequence-2.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/sequence/download/sequence-2.2.1.tgz"},"maintainers":[{"name":"coolaj86","email":""}],"publish_time":1338473327620,"_hasShrinkwrap":false,"_cnpm_publish_time":1338473327620},"2.2.0":{"name":"sequence","version":"2.2.0","description":"The sequence 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"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"_id":"sequence@2.2.0","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"020fa67ddcbad7da9ed770076772218854b2a6f3","size":1408,"noattachment":false,"key":"/sequence/-/sequence-2.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/sequence/download/sequence-2.2.0.tgz"},"maintainers":[{"name":"coolaj86","email":""}],"publish_time":1338014827029,"_hasShrinkwrap":false,"_cnpm_publish_time":1338014827029},"2.1.1":{"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","size":1093,"noattachment":false,"key":"/sequence/-/sequence-2.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/sequence/download/sequence-2.1.1.tgz"},"scripts":{},"publish_time":1310588827501,"maintainers":[{"name":"coolaj86","email":""}],"_hasShrinkwrap":false,"_cnpm_publish_time":1310588827501}},"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","_attachments":{},"homepage":"https://github.com/FuturesJS/sequence","bugs":{"url":"https://github.com/FuturesJS/sequence/issues"}}