{"_id":"slave","_rev":"14-d4e31aba4d28ddd143f946155eaa7afb","name":"slave","description":"seamlessly create long-running child processes","dist-tags":{"latest":"1.2.2"},"versions":{"0.0.0":{"name":"slave","description":"seamlessly create long-running child processes","version":"0.0.0","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/thenables/slave"},"dependencies":{"native-or-bluebird":"1","awaitable":"1","is-generator":"1"},"devDependencies":{"bluebird":"2","istanbul":"0","mocha":"1"},"scripts":{"test":"mocha --reporter spec","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"keywords":["slave","child","process","worker","thread"],"files":["index.js","slave.js","master.js"],"gitHead":"93248c5b7fb4f1171f87974e546295a2ab6edf5b","bugs":{"url":"https://github.com/thenables/slave/issues"},"homepage":"https://github.com/thenables/slave","_id":"slave@0.0.0","_shasum":"2de331efd6c5efff57c03eecef04a3b04363888c","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"dist":{"shasum":"2de331efd6c5efff57c03eecef04a3b04363888c","tarball":"https://registry.npmjs.org/slave/-/slave-0.0.0.tgz","integrity":"sha512-hY6KBsA+1XluxNhyjhhVHq98vvQIDm3l7vSECso0zCv+L3lybab/YCV+RNZCPT9vCHhOgPO2J3WQSZn7C6i4ew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAE7wAjnXmMOXGgHnA4gfEPI+TPc6enr/Zr92a/RlC/8AiEAi0ujO9urWoDgEGCkPTq7WoZ7thHus6Fttxkhi43SUwQ="}]}},"1.0.0":{"name":"slave","description":"seamlessly create long-running child processes","version":"1.0.0","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/thenables/slave"},"dependencies":{"native-or-bluebird":"1","awaitable":"1","is-generator":"1"},"devDependencies":{"bluebird":"2","istanbul":"0","mocha":"1"},"scripts":{"test":"mocha --reporter spec","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"keywords":["slave","child","process","worker","thread"],"files":["index.js","slave.js","master.js"],"gitHead":"471140fd7833ee778f3f267fc6f03e51d9070add","bugs":{"url":"https://github.com/thenables/slave/issues"},"homepage":"https://github.com/thenables/slave","_id":"slave@1.0.0","_shasum":"1892d94917e004692f21b92c2b15fb96707868cf","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"dist":{"shasum":"1892d94917e004692f21b92c2b15fb96707868cf","tarball":"https://registry.npmjs.org/slave/-/slave-1.0.0.tgz","integrity":"sha512-13HOu0vyNmtERb2nXFM+aRn6ZK38z6HX44ZMWhukFPE7sDsMpIYPOkyGLf57P5mKjcW4EAyy8w+AzHpQWyGKzQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDij+vkmAcRhnptryF5YBAUzlHuC4FUhQt5UPzRgX+6KAiBHbBIdwuSFxTDuuRG3cdbVeHMEKACDWauuY+6mbsgAuw=="}]}},"1.1.0":{"name":"slave","description":"seamlessly create long-running child processes","version":"1.1.0","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/thenables/slave"},"dependencies":{"native-or-bluebird":"1","awaitable":"1","is-generator":"1"},"devDependencies":{"bluebird":"2","istanbul":"0","mocha":"1"},"scripts":{"test":"mocha --reporter spec","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"keywords":["slave","child","process","worker","thread"],"files":["index.js","slave.js","master.js"],"gitHead":"cd12a0dca3f5ec898542427d8903c29a3cb359f6","bugs":{"url":"https://github.com/thenables/slave/issues"},"homepage":"https://github.com/thenables/slave","_id":"slave@1.1.0","_shasum":"dad0250829bef4f139982707e2273805277e0264","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"dist":{"shasum":"dad0250829bef4f139982707e2273805277e0264","tarball":"https://registry.npmjs.org/slave/-/slave-1.1.0.tgz","integrity":"sha512-MamcF2WPtebIq7hDWP4fM1Q9bllnQKDyVz7T5mDqomw6820K+EQdCLxJPDUthwOomJFSWm5fhxU1VB/0OTbbQg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDnipDCrazUaKFp9xujlgxKC8aF1PGQE8hzO13ZcDuNwAIhAJlSoX4RxsH2hND1gbj90uPSiylamBQYI0qy1CBru/WR"}]}},"1.2.0":{"name":"slave","description":"seamlessly create long-running child processes","version":"1.2.0","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/thenables/slave"},"dependencies":{"native-or-bluebird":"1","co":"4","is-generator":"1"},"devDependencies":{"bluebird":"2","istanbul":"0","mocha":"1"},"scripts":{"test":"mocha --reporter spec","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"keywords":["slave","child","process","worker","thread"],"files":["index.js","slave.js","master.js"],"gitHead":"a5d5bf30808e5a9b5c3f6735895b803b06782575","bugs":{"url":"https://github.com/thenables/slave/issues"},"homepage":"https://github.com/thenables/slave","_id":"slave@1.2.0","_shasum":"0105a3f0c8d66cd0806f18021357ee7b09e7df0e","_from":".","_npmVersion":"2.1.12","_nodeVersion":"0.11.14","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"dist":{"shasum":"0105a3f0c8d66cd0806f18021357ee7b09e7df0e","tarball":"https://registry.npmjs.org/slave/-/slave-1.2.0.tgz","integrity":"sha512-S1O5TRiE5CWELNZdRsvt0ju4h4NbME9O8y6wrFjZ3rHoSImY1tgjVjb7vRtjAz+CIE7tFq5FDghoVDvUFoF7Ug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEfem84F0MXWuyEKiyZxW3dnH9rQ3zqMnQU9nVehgOa1AiBI7zX/cg2apETaPTsbyEbbbU0gZffsRJ3N2CW+bsxLWw=="}]}},"1.2.1":{"name":"slave","description":"seamlessly create long-running child processes","version":"1.2.1","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/thenables/slave"},"dependencies":{"native-or-bluebird":"1","co":"4","is-generator":"1"},"devDependencies":{"bluebird":"2","istanbul":"0","mocha":"1"},"scripts":{"test":"mocha --reporter spec","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"keywords":["slave","child","process","worker","thread"],"files":["index.js","slave.js","master.js"],"gitHead":"e3d7d9903d7732d531d134455043d08e3de4b0e1","bugs":{"url":"https://github.com/thenables/slave/issues"},"homepage":"https://github.com/thenables/slave","_id":"slave@1.2.1","_shasum":"e697f55609a0146bb56568b2103590eb9397253b","_from":".","_npmVersion":"2.1.12","_nodeVersion":"0.11.14","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"dist":{"shasum":"e697f55609a0146bb56568b2103590eb9397253b","tarball":"https://registry.npmjs.org/slave/-/slave-1.2.1.tgz","integrity":"sha512-IRhDRQ5vqVxj9rE8IJJORrXtJAnpOg9pKUk+cWIyZI/MZvzmmrD7PCIBSiguTiF6gvgQXyyEk/g5XSnKGaoPGQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBrzK7Mb+JpS1bRvBS5udd0uaUfMdLexECt3SQtcbbgLAiEA6WtSUznBVIix81orEpgO2EHkRKLR+cvdHJ7DecBYpvY="}]}},"1.2.2":{"name":"slave","description":"seamlessly create long-running child processes","version":"1.2.2","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/thenables/slave"},"dependencies":{"native-or-bluebird":"1","co":"4","is-generator":"1"},"devDependencies":{"bluebird":"2","istanbul":"0","mocha":"1"},"scripts":{"test":"mocha --reporter spec","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"keywords":["slave","child","process","worker","thread"],"files":["index.js","slave.js","master.js"],"gitHead":"0e5212b2d1163ec9a44e5639c9c09b7205134db1","bugs":{"url":"https://github.com/thenables/slave/issues"},"homepage":"https://github.com/thenables/slave","_id":"slave@1.2.2","_shasum":"a221147c85597db820a858a6d9a2c9afa4f560b6","_from":".","_npmVersion":"2.1.12","_nodeVersion":"0.11.14","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"dist":{"shasum":"a221147c85597db820a858a6d9a2c9afa4f560b6","tarball":"https://registry.npmjs.org/slave/-/slave-1.2.2.tgz","integrity":"sha512-YZ0gLVHFv2SQLg6r5Gx2NY6F7xh/26y4+VwpbE6PWIzLBxc6g2ABlJCoJ2Bl1/6i/UpNUDkW7DepzwTAXmg+QQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDCVpIV0UKX/+i6dw54FoUNo2yk94xbbce/dYeoectnawIgZdv7rvJNPkzzsipRx0fXgNDyr+ZY6qgR+NIBjriWqRQ="}]}}},"readme":"\n# slave\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![Dependency Status][david-image]][david-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n[![Gittip][gittip-image]][gittip-url]\n\nSlave is a tiny utility to allow you to create long-running slave processes\nfor your node process and use these functions as promises.\nCreate modules that run in separate processes without anyone even knowing!\n\n## Walkthrough\n\nWrap your function in a slave.\nThe function must either:\n\n- Be a [co](https://github.com/visionmedia/co)-based generator function\n- A function that returns a promise\n- A synchronous function\n\nNow, create a separate `my-module/slave.js` file:\n\n```js\nvar slave = require('slave/slave');\nvar fn = require('./index.js'); // my main module\nslave(fn); // it's wrapped!\n```\n\nNow you can create a `my-module/master.js` file,\nwhich runs `slave.js`:\n\n```js\nvar master = require('slave/master');\nmodule.exports = master(require.resolve('./slave.js'))\n```\n\nNow users have two ways to use this module.\nDirectly:\n\n```js\nvar fn = require('my-module');\n\nfn(1, 2).then(function (val) {\n\n});\n```\n\nUsing child processes:\n\n```js\nvar fn = require('my-module/master');\n\nfn(1, 2).then(function (val) {\n\n});\n```\n\n## API\n\n### var fn = slave.master(slavepath, [options])\n\n\nCreate a function from a `slavepath`,\nwhich exports a `slave.slave()` function.\n\nOptions are:\n\n- `forks=0` - number of child processes to initiate immediately\n\n`fn` will __always__ return a promise,\neven if the wrapped function is synchronous.\n\n### fn.fork()\n\nCreate a new child process.\n\n### slave.slave(fn)\n\nHooks a function into `process` to allow the parent process to listen.\n\n[npm-image]: https://img.shields.io/npm/v/slave.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/slave\n[github-tag]: http://img.shields.io/github/tag/thenables/slave.svg?style=flat-square\n[github-url]: https://github.com/thenables/slave/tags\n[travis-image]: https://img.shields.io/travis/thenables/slave.svg?style=flat-square\n[travis-url]: https://travis-ci.org/thenables/slave\n[coveralls-image]: https://img.shields.io/coveralls/thenables/slave.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/thenables/slave?branch=master\n[david-image]: http://img.shields.io/david/thenables/slave.svg?style=flat-square\n[david-url]: https://david-dm.org/thenables/slave\n[license-image]: http://img.shields.io/npm/l/slave.svg?style=flat-square\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/slave.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/slave\n[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square\n[gittip-url]: https://www.gittip.com/jonathanong/\n","maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"time":{"modified":"2022-06-26T20:52:55.890Z","created":"2014-08-22T03:55:56.799Z","0.0.0":"2014-08-22T03:55:56.799Z","1.0.0":"2014-08-22T03:58:03.267Z","1.1.0":"2014-08-22T20:44:54.552Z","1.2.0":"2014-12-22T00:56:43.458Z","1.2.1":"2014-12-22T01:14:54.601Z","1.2.2":"2014-12-22T01:31:18.771Z"},"homepage":"https://github.com/thenables/slave","keywords":["slave","child","process","worker","thread"],"repository":{"type":"git","url":"https://github.com/thenables/slave"},"author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"bugs":{"url":"https://github.com/thenables/slave/issues"},"license":"MIT","readmeFilename":"README.md"}