{"_id":"express-cluster","_rev":"25-b57d158e586adfd860a24828fffa7e07","name":"express-cluster","description":"Simple drop-in for express apps to spawn multiple processes","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.0":{"name":"express-cluster","version":"0.0.0","description":"Simple drop-in for express apps to spawn multiple processes","main":"lib/index.js","repository":{"type":"git","url":"https://github.com/Flipboard/express-cluster.git"},"scripts":{"prepublish":"coffee -o lib/ -c src/index.coffee"},"keywords":["cluster","express","http","https","net","listener"],"author":{"name":"Eden Li","email":"eli@flipboard.com"},"license":"BSD-3-Clause","bugs":{"url":"https://github.com/Flipboard/express-cluster/issues"},"homepage":"https://github.com/Flipboard/express-cluster","devDependencies":{"coffee-script":"~1.6.3"},"_id":"express-cluster@0.0.0","dist":{"shasum":"dc65951be188c2e67cc3455498694ece5db47a8d","tarball":"https://registry.npmjs.org/express-cluster/-/express-cluster-0.0.0.tgz","integrity":"sha512-X6NFxw77BNqqEDSn7T9mFDjzriu80eIsH94uFtNbSEbRZ6hfgw3JQBlQrYcpAOw84QTDprvJDwvBVdcNa0ko7A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBjC8fKhS9PHVRvx7AmA2o5b21FYAfhrumCN8fwUMOVCAiAQ/R6anbYcAFA9v9oAkMf4ctv5MiQ1Fy1WNBLeNy9wbA=="}]},"_from":".","_npmVersion":"1.3.23","_npmUser":{"name":"eden","email":"eden@flipboard.com"},"maintainers":[{"name":"eden","email":"eden@flipboard.com"}]},"0.0.1":{"name":"express-cluster","version":"0.0.1","description":"Simple drop-in for express apps to spawn multiple processes","main":"lib/index.js","repository":{"type":"git","url":"https://github.com/Flipboard/express-cluster.git"},"scripts":{"prepublish":"coffee -o lib/ -c src/index.coffee"},"keywords":["cluster","express","http","https","net","listener"],"author":{"name":"Eden Li","email":"eli@flipboard.com"},"license":"BSD-3-Clause","bugs":{"url":"https://github.com/Flipboard/express-cluster/issues"},"homepage":"https://github.com/Flipboard/express-cluster","devDependencies":{"coffee-script":"~1.6.3"},"_id":"express-cluster@0.0.1","dist":{"shasum":"a8ecf76d5d66475001c3135387faf1bdf6882153","tarball":"https://registry.npmjs.org/express-cluster/-/express-cluster-0.0.1.tgz","integrity":"sha512-03bYW+SHlNhW/8HEpU9GU8BXuGiGZFBg6qNpWOSNjZJbH+4V+P4NRRvuNTUtiCradTzX4SHIdvkEA541ULow6A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcwjRMQxxBW3+a4RvqBTq7u11P6V3lGeaty0gLOsURbQIgVrHCV1OZNjr2BM/ZLfrQsod/pE7djO0BRte9nxwvLg0="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"eden","email":"eden@flipboard.com"},"maintainers":[{"name":"eden","email":"eden@flipboard.com"}]},"0.0.2":{"name":"express-cluster","version":"0.0.2","description":"Simple drop-in for express apps to spawn multiple processes","main":"lib/index.js","repository":{"type":"git","url":"https://github.com/Flipboard/express-cluster.git"},"scripts":{"prepublish":"coffee -o lib/ -c src/index.coffee"},"keywords":["cluster","express","http","https","net","listener"],"author":{"name":"Eden Li","email":"eli@flipboard.com"},"license":"BSD-3-Clause","bugs":{"url":"https://github.com/Flipboard/express-cluster/issues"},"homepage":"https://github.com/Flipboard/express-cluster","devDependencies":{"coffee-script":"~1.6.3"},"_id":"express-cluster@0.0.2","dist":{"shasum":"efe7b655f1cdcfb018a6d0751888635ee2492f1a","tarball":"https://registry.npmjs.org/express-cluster/-/express-cluster-0.0.2.tgz","integrity":"sha512-smAWM0pIRoG3LThClxA8EFKhsXhZc6/HL8NqD8FgpfwA4G1mWj48ola6zVn9Gy9uO1/6wfL9oDcnP/N/guin6w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAry/IumN78HdqO8uXQizffbD1o7N0fT1XgDwGQB0gyNAiEAzX+ZIo7KoLaJwJxfV3nA9tRya7gplFv3W9lUVeGMKPk="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"eden","email":"eden@flipboard.com"},"maintainers":[{"name":"eden","email":"eden@flipboard.com"}]},"0.0.3":{"name":"express-cluster","version":"0.0.3","description":"Simple drop-in for express apps to spawn multiple processes","main":"lib/index.js","repository":{"type":"git","url":"https://github.com/Flipboard/express-cluster.git"},"scripts":{"prepublish":"coffee -o lib/ -c src/index.coffee"},"keywords":["cluster","express","http","https","net","listener"],"author":{"name":"Eden Li","email":"eli@flipboard.com"},"license":"BSD-3-Clause","bugs":{"url":"https://github.com/Flipboard/express-cluster/issues"},"homepage":"https://github.com/Flipboard/express-cluster","devDependencies":{"coffee-script":"~1.8.0"},"gitHead":"31eb7a5ca4f9e4d5b855e5c80935b181796f49b7","_id":"express-cluster@0.0.3","_shasum":"cf6b6b8b7f62f9f0b02b7931121d2f03a1ba9ef7","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"eden","email":"eden@flipboard.com"},"maintainers":[{"name":"eden","email":"eden@flipboard.com"}],"dist":{"shasum":"cf6b6b8b7f62f9f0b02b7931121d2f03a1ba9ef7","tarball":"https://registry.npmjs.org/express-cluster/-/express-cluster-0.0.3.tgz","integrity":"sha512-o9sMh4ruougKcpLtUrPpcnjlEldg8uaBNoBlh0RKRPClqrIZ9iW7+vAVjy9e/Eh1GXuND5Qb+vDdm1V1lz6epg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICfA667FEW0k6u+9gN+XO4n4pnNzop1PvhaqaCbMvR14AiEAp6APJ0qUW3dAti/uDjw3sC5tdbfHC0GUCs8+Y7BWGmo="}]}},"0.0.4":{"name":"express-cluster","version":"0.0.4","description":"Simple drop-in for express apps to spawn multiple processes","main":"lib/index.js","repository":{"type":"git","url":"https://github.com/Flipboard/express-cluster.git"},"scripts":{"prepublish":"coffee -o lib/ -c src/index.coffee"},"keywords":["cluster","express","http","https","net","listener"],"author":{"name":"Eden Li","email":"eli@flipboard.com"},"license":"BSD-3-Clause","bugs":{"url":"https://github.com/Flipboard/express-cluster/issues"},"homepage":"https://github.com/Flipboard/express-cluster","devDependencies":{"coffee-script":"~1.10.0"},"gitHead":"974423e7045395d75c3c22179f62491965195719","_id":"express-cluster@0.0.4","_shasum":"7aa5c39779bbc7550a30525d02b4c022e40b8798","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.12.2","_npmUser":{"name":"eden","email":"eden@flipboard.com"},"maintainers":[{"name":"eden","email":"eden@flipboard.com"}],"dist":{"shasum":"7aa5c39779bbc7550a30525d02b4c022e40b8798","tarball":"https://registry.npmjs.org/express-cluster/-/express-cluster-0.0.4.tgz","integrity":"sha512-XlAqlw5mp9nxq0ELGNPRO2co8Y8cM4xG4t3hG/La2T8cyx1rUfqnNCHFBJcUUEY9yHykTxr3HER5/K6MRYgisg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCduiQXUR9cH6vvJm7gYKwm8RwDDIFHG5rtZi5TwfEgcwIhAPQDiJq+BNFetJXzPlBw9EWWxpllgXJsNdDBtS/einC1"}]}},"0.0.5":{"name":"express-cluster","version":"0.0.5","description":"Simple drop-in for express apps to spawn multiple processes","main":"lib/index.js","repository":{"type":"git","url":"git+https://github.com/Flipboard/express-cluster.git"},"scripts":{"prepublish":"coffee -o lib/ -c src/index.coffee"},"keywords":["cluster","express","http","https","net","listener"],"author":{"name":"Eden Li","email":"eli@flipboard.com"},"license":"BSD-3-Clause","bugs":{"url":"https://github.com/Flipboard/express-cluster/issues"},"homepage":"https://github.com/Flipboard/express-cluster","devDependencies":{"coffee-script":"~1.10.0"},"gitHead":"c1aca8f1cdc740368f084c9c911c4d961767b14d","_id":"express-cluster@0.0.5","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"eden","email":"eden@packagd.com"},"dist":{"integrity":"sha512-Wo0i4YFdj1341nkCxXO9zcO6ZGgiTiFEi+KMwE8bZexGg1sY2GmeDyHHEUDI+zSUJsQDSlT1EQSBnh5XaPIFVQ==","shasum":"516c881b2a8f5d73bf2e3bbc2ea9540678aadefc","tarball":"https://registry.npmjs.org/express-cluster/-/express-cluster-0.0.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgp+z2MFivIyR3h3Jso7rxcHxpZsQw/wMelezguFNuRwIhAKK2Xqql69BOElFmf5OOhE/g+Zy034oQPXsUAQNPRlB0"}]},"maintainers":[{"name":"eden","email":"eden@flipboard.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/express-cluster-0.0.5.tgz_1504761266242_0.8816837202757597"}}},"readme":"# express-cluster\n\nRun an express server on multiple processes. This is meant to be dropped in\ndirectly to your main entry point without having to setup a separate script\nthat manages workers.\n\nThis works with any EventListener that emits the `\"close\"` event and has a\n`close()` method. If it's a server object (e.g. an express app, `net.Server` or\n`http.Server`, ensure that you've invoked `listen` before returning it).\n\nBy default the module will spawn `os.cpus().length` workers. You should\nconfigure this parameter for your workloads. You should pick the right number\nfor your server based on testing.\n\n## Synopsis\n\n    var express = require('express');\n    var cluster = require('express-cluster');\n\n    cluster(function(worker) {\n        var app = express();\n        app.get('/', function(req, res) {\n            res.send('hello from worker #' + worker.id);\n        });\n        return app.listen(0xbeef);\n    }, {count: 5})\n\n## API\n\nexpress-cluster exports itself as a function that accepts `config` and\n`workerFunctions` as arguments. These can be provided in either order:\n`cluster(config, workerFunction)` or `cluster(workerFunction, config)`.\n\nOnce node executes `cluster()` the current process will be forked the specified\nnumber of times. You should guard any code that should only be run in the\nmaster behind a check of `process.env.NODE_UNIQUE_ID` or a call to node's\n[cluster.isMaster](https://nodejs.org/api/cluster.html#cluster_cluster_ismaster)\n\n### `workerFunction`\n\nThis function is passed a `worker` object. See the node documentation for\n[Worker](https://nodejs.org/api/cluster.html#cluster_class_worker) for details.\n\n### `config`\n\nThis object should contain zero or more of these keys. Any other key/values are\nignored.\n\n    {\n        count: 5,       // number of workers: defaults to os.cpus().length\n        respawn: true,  // respawn process on exit: defaults to true\n        verbose: false, // log what happens to console: defaults to false\n\n        // Attach the given function to each spawned worker. The function will\n        // be bound to the worker that sent the message so you can setup a two\n        // way message bus if you please. See examples/messaging.js for an\n        // example.\n        workerListener: function(){},\n\n        // When in verbose mode, use a following writable stream (supports\n        // the write function) instead of the default console\n        outputStream: writableStream\n    }\n","maintainers":[{"name":"eden","email":"eden@flipboard.com"}],"time":{"modified":"2022-06-17T22:12:19.874Z","created":"2014-01-14T23:23:27.731Z","0.0.0":"2014-01-14T23:23:27.731Z","0.0.1":"2014-03-05T20:57:33.227Z","0.0.2":"2014-03-06T18:19:33.626Z","0.0.3":"2014-11-19T22:08:06.728Z","0.0.4":"2015-09-18T17:15:20.606Z","0.0.5":"2017-09-07T05:14:26.356Z"},"homepage":"https://github.com/Flipboard/express-cluster","keywords":["cluster","express","http","https","net","listener"],"repository":{"type":"git","url":"git+https://github.com/Flipboard/express-cluster.git"},"author":{"name":"Eden Li","email":"eli@flipboard.com"},"bugs":{"url":"https://github.com/Flipboard/express-cluster/issues"},"license":"BSD-3-Clause","readmeFilename":"README.md","users":{"wangxian":true,"jimmykuo":true,"jybleau":true,"adammcarth":true,"tomrush":true,"hugojosefson":true,"mattyb":true,"goatandsheep":true,"bengi":true,"rahulraghavankklm":true,"suncn":true}}