{"id":13487682,"url":"https://github.com/atian25/egg-remote-config","last_synced_at":"2025-07-08T16:34:17.658Z","repository":{"id":57220718,"uuid":"281827884","full_name":"atian25/egg-remote-config","owner":"atian25","description":"workaround for egg remote config","archived":false,"fork":false,"pushed_at":"2021-08-27T01:28:54.000Z","size":18,"stargazers_count":23,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-16T11:39:50.783Z","etag":null,"topics":["egg","egg-plugin","eggjs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atian25.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"atian25","patreon":"atian25","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-07-23T02:14:13.000Z","updated_at":"2024-12-11T06:29:49.000Z","dependencies_parsed_at":"2022-08-29T04:01:35.597Z","dependency_job_id":null,"html_url":"https://github.com/atian25/egg-remote-config","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/atian25/egg-remote-config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atian25%2Fegg-remote-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atian25%2Fegg-remote-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atian25%2Fegg-remote-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atian25%2Fegg-remote-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atian25","download_url":"https://codeload.github.com/atian25/egg-remote-config/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atian25%2Fegg-remote-config/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260506630,"owners_count":23019418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["egg","egg-plugin","eggjs"],"created_at":"2024-07-31T18:01:02.015Z","updated_at":"2025-06-28T10:36:58.944Z","avatar_url":"https://github.com/atian25.png","language":"JavaScript","funding_links":["https://github.com/sponsors/atian25","https://patreon.com/atian25"],"categories":["仓库"],"sub_categories":["插件"],"readme":"# egg-remote-config\n\n[![NPM version][npm-image]][npm-url]\n[![Node.js CI][action-image]][action-url]\n[![Test coverage][codecov-image]][codecov-url]\n\n\n[npm-image]: https://img.shields.io/npm/v/egg-remote-config.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/egg-remote-config\n[action-image]: https://github.com/atian25/egg-remote-config/workflows/Node.js%20CI/badge.svg\n[action-url]: https://github.com/atian25/egg-remote-config/actions?query=workflow%3A%22Node.js+CI%22\n[codecov-image]: https://codecov.io/gh/atian25/egg-remote-config/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/atian25/egg-remote-config\n\nWorkaround for egg remote config.\n\nBecause Egg Config Loader is sync, but sometime we need to load remote config.\n\nSo, this plugin will load remote config at agent's lifecycle, then write to file, then readFileSync at worker's lifecycle.\n\n## Install\n\n```bash\n$ npm i --save egg-remote-config\n```\n\n## Usage\n\n```js\n// {app_root}/config/plugin.js\nexports.remoteConfig = {\n  enable: true,\n  package: 'egg-remote-config',\n};\n```\n\n## Configuration\n\n```js\n// {app_root}/config/config.default.js\nexports.remoteConfig = {\n  async handler(agent) {\n    // will override app.config\n    const { data } = await agent.curl('http://remote-url/config', { dataType: 'json', contentType: 'json' });\n    return data;\n  }\n};\n```\n\nsee [config/config.default.js](config/config.default.js) for more detail.\n\n## Example\n\n\u003c!-- example here --\u003e\n\n## Questions \u0026 Suggestions\n\nPlease open an issue [here](https://github.com/atian25/egg-remote-config/issues).\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatian25%2Fegg-remote-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatian25%2Fegg-remote-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatian25%2Fegg-remote-config/lists"}