{"_id":"runs","_rev":"4-9041b8c872050d3434bf8e4f76dd5331","name":"runs","description":"A simple run loop.","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"runs","version":"1.0.0","description":"A simple run loop.","homepage":"https://github.com/shama/runs","main":"index.js","scripts":{"test":"node test/test.js"},"author":{"name":"Kyle Robinson Young","email":"kyle@dontkry.com","url":"http://dontkry.com"},"repository":{"type":"git","url":"git://github.com/shama/runs.git"},"bugs":{"url":"https://github.com/shama/runs/issues"},"license":"MIT","dependencies":{},"devDependencies":{"tape":"^4.2.2"},"gitHead":"2edd861b73cc4985ebe3fc9ddcdf364bb0b6a727","_id":"runs@1.0.0","_shasum":"359bd76a12f41bdb5b18cc81f40ff162b9de22b8","_from":".","_npmVersion":"2.1.1","_nodeVersion":"4.0.0","_npmUser":{"name":"shama","email":"kyle@dontkry.com"},"maintainers":[{"name":"shama","email":"kyle@dontkry.com"}],"dist":{"shasum":"359bd76a12f41bdb5b18cc81f40ff162b9de22b8","tarball":"https://registry.npmjs.org/runs/-/runs-1.0.0.tgz","integrity":"sha512-/Kf5zZUUGWDT2qbgV2l1rQI5kF8AJ3kLuYTRu575/vNWmhwKNVKscFDOsBuiRh1UEzPRwGr79um/wZbslaGHew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTYo2KLDWP/+4B6NDpMrVW4ehd1dMBO6ooIfDukJHJNAIgWp+E9gdxl03WawTudlH/lZdD2hUIFo90lOr3TfHe08s="}]}},"1.0.1":{"name":"runs","version":"1.0.1","description":"A simple run loop.","homepage":"https://github.com/shama/runs","main":"index.js","scripts":{"test":"node test/test.js"},"author":{"name":"Kyle Robinson Young","email":"kyle@dontkry.com","url":"http://dontkry.com"},"repository":{"type":"git","url":"git://github.com/shama/runs.git"},"bugs":{"url":"https://github.com/shama/runs/issues"},"license":"MIT","dependencies":{},"devDependencies":{"tape":"^4.2.2"},"gitHead":"64202f7102dd3589ba888ef3b852b106301d2f20","_id":"runs@1.0.1","_shasum":"88170426b24b3d2dfe7a00f7b9170ccbf518c349","_from":".","_npmVersion":"2.1.1","_nodeVersion":"4.0.0","_npmUser":{"name":"shama","email":"kyle@dontkry.com"},"maintainers":[{"name":"shama","email":"kyle@dontkry.com"}],"dist":{"shasum":"88170426b24b3d2dfe7a00f7b9170ccbf518c349","tarball":"https://registry.npmjs.org/runs/-/runs-1.0.1.tgz","integrity":"sha512-ZGUwF9HwtU1gHAAoyiSCdHeksLvJ6UGuKXzATacKWy5aMtfNUbq6UtpCtOqPQzNnNmoLuoJdoSKfi8PBgHTZBw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCghSV585yfs2hxXGDFXQ6c6Rvgv6IxE6SMXwvt0yxKowIhALw3C0TId+DT9Xl9dobiV/o1/MkTnQJY8Cq0XNHImloH"}]}}},"readme":"# runs [![Build Status](http://img.shields.io/travis/shama/runs.svg)](https://travis-ci.org/shama/runs)\n\nA simple run loop.\n\n## install\n\n```shell\nnpm install runs --save\n```\n\n## usage\n\n```js\nvar r = require('runs')()\n\nr.andThen(function () {\n  console.log('first')\n})\nr.andThen(function () {\n  r.wait()\n  setTimeout(function () {\n    console.log('second')\n    r.resume()\n  }, 500)\n  r.andThen(function () {\n    console.log('third')\n  })\n})\nr.andThen(function () {\n  console.log('fourth')\n})\n\nr.run()\n```\n\n## API\n\n### `createRuns = require('runs')`\n\n#### `runs = createRuns([customQueue])`\n\n* `customQueue` {Function} A function for custom handling on how tasks get queued.\n\n#### `runs.andThen(task)`\n\nSchedule a synchronous task in the run loop.\n\n#### `runs.wait()`\n\nSchedule the run loop to wait for a subsequent `resume()` call.\n\n#### `runs.resume()`\n\nTell the run loop to resume running tasks.\n\n#### `runs.cancel()`\n\nTell the run loop to cancel the current run.\n\n#### `runs.run([done])`\n\nStart running the tasks queued and call a `done` function when all tasks have\nfinished.\n\n## License\nCopyright (c) 2015 Kyle Robinson Young  \nLicensed under the MIT license.\n","maintainers":[{"name":"shama","email":"kyle@dontkry.com"}],"time":{"modified":"2022-06-26T14:52:44.838Z","created":"2015-12-15T05:36:47.161Z","1.0.0":"2015-12-15T05:36:47.161Z","1.0.1":"2015-12-15T05:42:17.608Z"},"homepage":"https://github.com/shama/runs","repository":{"type":"git","url":"git://github.com/shama/runs.git"},"author":{"name":"Kyle Robinson Young","email":"kyle@dontkry.com","url":"http://dontkry.com"},"bugs":{"url":"https://github.com/shama/runs/issues"},"license":"MIT","readmeFilename":"README.md"}