{"name":"egg-cluster","version":"2.4.0","keywords":["egg","cluster","process"],"author":{"name":"dead-horse","email":"dead_horse@qq.com"},"license":"MIT","_id":"egg-cluster@2.4.0","maintainers":[{"name":"gxkl","email":"gxkl203@gmail.com"},{"name":"eggjs-admin","email":"fengmk2+eggjs@gmail.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"atian25","email":"atian25@qq.com"},{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"wanghx","email":"whxaxes@gmail.com"},{"name":"hyj1991","email":"yeekwanvong@gmail.com"},{"name":"killagu","email":"killa07071201@gmail.com"},{"name":"coolme200","email":"2001-wms@163.com"},{"name":"mansonchor.zzw","email":"mansonchor1987@gmail.com"},{"name":"hubcarl","email":"hubcarl@126.com"},{"name":"gemwuu","email":"gemwuu@gmail.com"},{"name":"akitasummer","email":"644171127@qq.com"},{"name":"popomore","email":"sakura9515@gmail.com"}],"homepage":"https://github.com/eggjs/egg-cluster#readme","bugs":{"url":"https://github.com/eggjs/egg-cluster/issues"},"dist":{"shasum":"637b9a4062c5e88803c387e08b1c692da6ac6559","tarball":"http://registry-npm.ywwl.com/egg-cluster/download/egg-cluster-2.4.0.tgz","fileCount":18,"integrity":"sha512-Cv3OqEBIJ1iEWjXZ/ylE+Xc8n900x2f04Pwx7mh+rCzVdZWY4kPpc++FmItYpDUCkXjn6VZL2Caa4DL89zgidQ==","signatures":[{"sig":"MEYCIQCTD6VxK8OgHqujsCyMStT1IlOobCGrGy1nYPvzcVbWPgIhAPZ5AZxrUmZHUG+0DurqeI3pQWyqxNdbr4kdxtGYL/uL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/egg-cluster@2.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":58872,"size":14817,"noattachment":false,"key":"/egg-cluster/-/egg-cluster-2.4.0.tgz"},"main":"index.js","engines":{"node":">= 14.0.0"},"gitHead":"5da82538b16aa20dc40428e22ecbfe86db373e4b","scripts":{"ci":"npm run lint && npm run cov","cov":"egg-bin cov --prerequire --timeout 100000 --ts false","lint":"eslint .","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test --ts false"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"repository":{"url":"git+https://github.com/eggjs/egg-cluster.git","type":"git"},"_npmVersion":"10.8.2","description":"cluster manager for egg","directories":{},"_nodeVersion":"18.20.5","dependencies":{"cfork":"^1.7.1","ps-tree":"^1.2.0","utility":"^1.15.0","egg-utils":"^2.4.1","get-ready":"^2.0.1","egg-logger":"^3.3.0","is-type-of":"^1.2.1","await-event":"^2.1.0","detect-port":"^2.0.1","sendmessage":"^1.1.0","terminal-link":"^2.1.1","cluster-reload":"^1.0.2","graceful-process":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"egg":"^3.9.0","coffee":"^5.2.1","eslint":"^8.26.0","urllib":"^3.17.1","address":"^1.0.3","egg-bin":"^6.4.0","pedding":"^1.1.0","ts-node":"^10.9.1","egg-mock":"^5.4.0","supertest":"^4.0.0","egg-errors":"^2.2.0","typescript":"^5.0.4","eslint-config-egg":"^12.1.0"},"_npmOperationalInternal":{"tmp":"tmp/egg-cluster_2.4.0_1733709083951_0.44219420128589837","host":"s3://npm-registry-packages-npm-production"},"readme":"# egg-cluster\n\n[![NPM version][npm-image]][npm-url]\n[![CI](https://github.com/eggjs/cluster/actions/workflows/nodejs.yml/badge.svg)](https://github.com/eggjs/cluster/actions/workflows/nodejs.yml)\n[![Test coverage][codecov-image]][codecov-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/egg-cluster.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/egg-cluster\n[codecov-image]: https://codecov.io/github/eggjs/cluster/coverage.svg?branch=master\n[codecov-url]: https://codecov.io/github/eggjs/cluster?branch=master\n[snyk-image]: https://snyk.io/test/npm/egg-cluster/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/egg-cluster\n[download-image]: https://img.shields.io/npm/dm/egg-cluster.svg?style=flat-square\n[download-url]: https://npmjs.org/package/egg-cluster\n\nCluster Manager for EggJS\n\n---\n\n## Install\n\n```bash\nnpm i egg-cluster --save\n```\n\n## Usage\n\n```js\nconst startCluster = require('egg-cluster').startCluster;\nstartCluster({\n  baseDir: '/path/to/app',\n  framework: '/path/to/framework',\n});\n```\n\nYou can specify a callback that will be invoked when application has started. However, master process will exit when catch an error.\n\n```js\nstartCluster(options, () => {\n  console.log('started');\n});\n```\n\n## Options\n\n| Param        | Type      | Description                              |\n| ------------ | --------- | ---------------------------------------- |\n| baseDir      | `String`  | directory of application                 |\n| framework    | `String`  | specify framework that can be absolute path or npm package |\n| plugins      | `Object`  | plugins for unittest                     |\n| workers      | `Number`  | numbers of app workers                   |\n| sticky       | `Boolean` | sticky mode server                       |\n| port         | `Number`  | port                                     |\n| reusePort   | `Boolean` | (Required Node.js >= 22.12.0) allows multiple sockets on the same host to bind to the same port. Incoming connections are distributed by the operating system to listening sockets. This option is available only on some platforms, such as Linux 3.9+, DragonFlyBSD 3.6+, FreeBSD 12.0+, Solaris 11.4, and AIX 7.2.5+. **Default:** `false` |\n| debugPort    | `Number`  | the debug port only listen on http protocol |\n| https        | `Object`  | start a https server, note: `key` / `cert` / `ca` should be full path to file |\n| require      | `Array\\|String` | will inject into worker/agent process |\n| pidFile      | `String`  | will save master pid to this file |\n| startMode    | `String`  | default is 'process', use 'worker_threads' to start the app & agent worker by worker_threads |\n| ports        | `Array`   | startup port of each app worker, such as: [7001, 7002, 7003], only effects when the `startMode` is `'worker_threads'` and `reusePort` is `false` |\n| env        | `String`   | custom env, default is process.env.EGG_SERVER_ENV |\n\n## Env\n\nEGG_APP_CLOSE_TIMEOUT: app worker boot timeout value\n\nEGG_AGENT_CLOSE_TIMEOUT: agent worker boot timeout value\n\n## License\n\n[MIT](LICENSE)\n\n## Contributors\n\n[![Contributors](https://contrib.rocks/image?repo=eggjs/cluster)](https://github.com/eggjs/cluster/graphs/contributors)\n\nMade with [contributors-img](https://contrib.rocks).\n","publish_time":1733709084169,"_cnpm_publish_time":1733709084169,"dist-tags":{"beta":"2.4.0-beta.0","latest":"2.5.0"}}