{"id":13903220,"url":"https://github.com/sjinks/node-config-reloadable","last_synced_at":"2025-04-10T00:40:46.206Z","repository":{"id":35001578,"uuid":"194780584","full_name":"sjinks/node-config-reloadable","owner":"sjinks","description":"Reloadable version of lorenwest/node-config","archived":false,"fork":false,"pushed_at":"2025-03-03T03:02:59.000Z","size":992,"stargazers_count":8,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-05T05:02:22.332Z","etag":null,"topics":["config","configuration","node-config","reload-config"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/config-reloadable","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/sjinks.png","metadata":{"funding":{"custom":["https://www.paypal.com/donate/?hosted_button_id=SAG6877JDJ3KU","https://send.monobank.ua/jar/7rosVfiwKM"]},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-02T03:19:29.000Z","updated_at":"2025-03-03T03:03:02.000Z","dependencies_parsed_at":"2023-10-27T11:22:21.796Z","dependency_job_id":"59940506-dc05-4c7c-b98b-b52ff86817d6","html_url":"https://github.com/sjinks/node-config-reloadable","commit_stats":{"total_commits":225,"total_committers":8,"mean_commits":28.125,"dds":0.5733333333333333,"last_synced_commit":"92d9db2f8747dec8832b17cdd30ef78d150d8e91"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fnode-config-reloadable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fnode-config-reloadable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fnode-config-reloadable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fnode-config-reloadable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjinks","download_url":"https://codeload.github.com/sjinks/node-config-reloadable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137996,"owners_count":21053775,"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":["config","configuration","node-config","reload-config"],"created_at":"2024-08-06T22:01:53.078Z","updated_at":"2025-04-10T00:40:46.187Z","avatar_url":"https://github.com/sjinks.png","language":"JavaScript","funding_links":["https://www.paypal.com/donate/?hosted_button_id=SAG6877JDJ3KU","https://send.monobank.ua/jar/7rosVfiwKM"],"categories":["config"],"sub_categories":[],"readme":"# node-config-reloadable\n\n[![Build and Test](https://github.com/sjinks/node-config-reloadable/actions/workflows/build.yml/badge.svg)](https://github.com/sjinks/node-config-reloadable/actions/workflows/build.yml)\n[![npm version](https://img.shields.io/npm/v/config-reloadable.svg)](https://www.npmjs.com/package/config-reloadable)\n\nReloadable version of [lorenwest/node-config](https://github.com/lorenwest/node-config)\n\n# Install\n\n```sh\nnpm install --save config-reloadable\n```\n\n# Why?\n\nIt looks like there is no [official support](https://github.com/lorenwest/node-config/issues/34) for reloading configuration files;\ninstead, the author suggest a [workaround](https://github.com/lorenwest/node-config/issues/34#issuecomment-9039129), which, unfortunately,\ndoes not always work (for example, if your configuration files are `*.js`).\n\n`config-reloadable` forces `node-config` to reload configuration files by clearing the [require cache](https://nodejs.org/api/modules.html#modules_require_cache)\nfor both `node-config` itself and all configuration files that have been loaded.\n\n# Example\n\n```js\nconst config = require('config-reloadable');\n\nconsole.log(config().something);\n\n// Now change that `something`\n\nconfig.reloadConfigs();\n\nconsole.log(config().something);\n\n// Displayed values should differ\n```\n\nInstead of `config.reloadConfigs()` it is possible to use `config(true)` (it is less intuitive but makes the code less verbose).\n\nReload configuration files on `SIGHUP`:\n\n```js\nconst config = require('config-reloadable');\n\nlet conf = config();\n\nprocess.on('SIGHUP', function () {\n  conf = config.reloadConfigs();\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjinks%2Fnode-config-reloadable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjinks%2Fnode-config-reloadable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjinks%2Fnode-config-reloadable/lists"}