{"name":"@eggjs/cluster","version":"4.0.2-beta.20","keywords":["cluster","egg","process"],"author":{"name":"dead-horse","email":"dead_horse@qq.com"},"license":"MIT","_id":"@eggjs/cluster@4.0.2-beta.20","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":"hyj1991","email":"yeekwanvong@gmail.com"},{"name":"killagu","email":"killa07071201@gmail.com"},{"name":"coolme200","email":"2001-wms@163.com"},{"name":"akitasummer","email":"644171127@qq.com"},{"name":"elrrrrrrr","email":"elrrrrrrr@gmail.com"},{"name":"niania","email":"ljracm@gmail.com"}],"homepage":"https://github.com/eggjs/egg/tree/next/packages/cluster","bugs":{"url":"https://github.com/eggjs/egg/issues"},"dist":{"shasum":"da791e5ab207543dd4e78a2dffccbf61cc971ce6","tarball":"http://registry-npm.ywwl.com/@eggjs/cluster/download/@eggjs/cluster-4.0.2-beta.20.tgz","fileCount":34,"integrity":"sha512-edoOx5n+p0gi9nNNFqJgBeaGstPbVnS4eeFIyCdZpzhuAtFwQehhAF0io4LD3Fj7Us9AHcx9RsRxWt8WXtqyhQ==","signatures":[{"sig":"MEQCIAsAf4djK6FL8S67JzXn5RtlGfaH+kOKRt1YsZZVJZGtAiBtQt4wFViCIHagg8Hc38ovRudQMAwduT+sFMGUkZN39A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@eggjs%2fcluster@4.0.2-beta.20","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":72554,"size":17553,"noattachment":false,"key":"/@eggjs/cluster/-/@eggjs/cluster-4.0.2-beta.20.tgz"},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22.18.0"},"exports":{".":"./dist/index.js","./app_worker":"./dist/app_worker.js","./agent_worker":"./dist/agent_worker.js","./package.json":"./package.json"},"gitHead":"3ddbbe45a32aff0bcf854b8cd28489f4e0836b5f","scripts":{"lint":"oxlint","test":"vitest run","typecheck":"tsgo --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d3c6dbc3-6ae6-4318-8c97-f0b9722283cd"}},"repository":{"url":"git+https://github.com/eggjs/egg.git","type":"git","directory":"packages/cluster"},"_npmVersion":"11.16.0","description":"cluster manager for egg","directories":{},"_nodeVersion":"24.18.0","dependencies":{"cfork":"^2.0.0","utility":"^2.5.0","get-ready":"^3.1.0","egg-logger":"^3.5.0","detect-port":"^2.1.0","sendmessage":"^3.0.1","@eggjs/utils":"5.0.2-beta.20","terminal-link":"^5.0.0","cluster-reload":"^2.0.0","@fengmk2/ps-tree":"^2.0.1","graceful-process":"^2.0.0"},"publishConfig":{"access":"public","exports":{".":"./dist/index.js","./app_worker":"./dist/app_worker.js","./agent_worker":"./dist/agent_worker.js","./package.json":"./package.json"}},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"coffee":"5","tsdown":"^0.18.2","urllib":"^4.8.2","vitest":"^4.0.15","address":"2","typescript":"^5.9.3","@eggjs/mock":"7.0.2-beta.20","@eggjs/errors":"3.0.2-beta.20","@eggjs/tsconfig":"3.1.2-beta.20","@eggjs/supertest":"9.0.2-beta.20"},"_npmOperationalInternal":{"tmp":"tmp/cluster_4.0.2-beta.20_1783609762604_0.6277542435079435","host":"s3://npm-registry-packages-npm-production"},"readme":"# @eggjs/cluster\n\n[![NPM version][npm-image]][npm-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n[![Node.js Version](https://img.shields.io/node/v/@eggjs/cluster.svg?style=flat)](https://nodejs.org/en/download/)\n\n[npm-image]: https://img.shields.io/npm/v/@eggjs/cluster.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/@eggjs/cluster\n[snyk-image]: https://snyk.io/test/npm/@eggjs/cluster/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/@eggjs/cluster\n[download-image]: https://img.shields.io/npm/dm/@eggjs/cluster.svg?style=flat-square\n[download-url]: https://npmjs.org/package/@eggjs/cluster\n\nCluster Manager for EggJS\n\n## Install\n\n```bash\nnpm i @eggjs/cluster\n```\n\n## Usage\n\nCommonJS\n\n```js\nconst { startCluster } = require('@eggjs/cluster');\n\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.\nHowever, master process will exit when catch an error.\n\n```js\nstartCluster(options).then(() => {\n  console.log('started');\n});\n```\n\nESM and TypeScript\n\n```ts\nimport { startCluster } from '@eggjs/cluster';\n\nstartCluster({\n  baseDir: '/path/to/app',\n  framework: '/path/to/framework',\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| 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' |\n| env       | `String`        | custom env, default is process.env.EGG_SERVER_ENV                                                                 |\n\n## Env\n\n`EGG_APP_CLOSE_TIMEOUT`: app worker boot timeout value\n\n`EGG_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/egg)](https://github.com/eggjs/egg/graphs/contributors)\n\nMade with [contributors-img](https://contrib.rocks).\n","publish_time":1783609762753,"_cnpm_publish_time":1783609762753,"dist-tags":{"beta":"4.0.2-beta.27","latest":"4.1.0","rc":"4.0.2-rc.1"}}