{"id":19543614,"url":"https://github.com/nodecloud/nodecloud-config-client","last_synced_at":"2025-11-20T01:00:43.709Z","repository":{"id":57311269,"uuid":"93289852","full_name":"nodecloud/nodecloud-config-client","owner":"nodecloud","description":"A client for spring-cloud-config-server written by node.","archived":false,"fork":false,"pushed_at":"2017-10-24T06:47:35.000Z","size":27,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-14T05:38:34.952Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nodecloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-04T04:21:46.000Z","updated_at":"2025-07-03T12:24:26.000Z","dependencies_parsed_at":"2022-09-06T04:40:41.650Z","dependency_job_id":null,"html_url":"https://github.com/nodecloud/nodecloud-config-client","commit_stats":null,"previous_names":["node-cloud/node-cloud-config-client"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nodecloud/nodecloud-config-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodecloud%2Fnodecloud-config-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodecloud%2Fnodecloud-config-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodecloud%2Fnodecloud-config-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodecloud%2Fnodecloud-config-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodecloud","download_url":"https://codeload.github.com/nodecloud/nodecloud-config-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodecloud%2Fnodecloud-config-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285354074,"owners_count":27157385,"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","status":"online","status_checked_at":"2025-11-19T02:00:05.673Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-11T03:19:58.587Z","updated_at":"2025-11-20T01:00:43.648Z","avatar_url":"https://github.com/nodecloud.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NodeCloud-Config-Client\n\nThis is a client for springcloud-config-server written by node.\n\n## Usage\n```\nnpm install nodecloud-config-client --save\n```\n\n```javascript\nimport Client, {CONFIG_REFRESH_EVENT, ERROR_EVENT} from 'nodecloud-config-client';\nimport path from 'path';\n\nconst client = new Client({\n    remote: {\n        url: 'http://localhost:8888/:service/:env',\n        service: 'service',\n        interval: 60000,\n        watch: false\n    },\n    local: {\n        path: path.resolve(__dirname),\n        service: 'service',\n        ext: 'yml'\n    }\n});\n\nclient.on(CONFIG_REFRESH_EVENT, config =\u003e {\n    console.log(config);\n});\n\nclient.on(\"web.port\", port =\u003e {\n    console.log('The port is ' + port);\n});\n\nclient.on(ERROR_EVENT, err =\u003e {\n    console.log(err);\n});\n```\n\n## API\n\n### new ConfigClient(options)\n\n* @param options\n* @param options.remote.url (params: {service, env})\n* @param options.remote.client Custom http client. It's an object implement send method with promisify.\n* @param options.remote.service The name of the service.\n* @param options.remote.interval How long to refresh the configuration, default is one minute.(millisecond)\n* @param options.remote.watch\n\n* @param options.local.path The position of the local config file.\n* @param options.local.service The name of the service.\n* @param options.local.ext The file type of the configuration, supports js or yml.\n\n### client.on(eventName, callback)\n\n* CONFIG_REFRESH_EVENT\n* ERROR_EVENT\n* Your configuration path\n\n### await client.getConfig()\n\n### await client.getConfig(path, defaultValue)\n\n### client.destroy()\n\n## Custom http client\n\n```\nimport rp from 'request-promise';\n\nconst options = {\n    remote: {\n        client: {\n            send(request) {\n                //compile uri params.\n                request.url = uriParams(request.url, request.params);\n\n                //force setting the config.\n                request.simple = true;\n                request.json = true;\n                request.resolveWithFullResponse = false;\n                return rp(request);\n            }\n        }\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodecloud%2Fnodecloud-config-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodecloud%2Fnodecloud-config-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodecloud%2Fnodecloud-config-client/lists"}