{"id":22059230,"url":"https://github.com/opentable/spur-config","last_synced_at":"2025-05-12T19:43:59.487Z","repository":{"id":24211435,"uuid":"27603181","full_name":"opentable/spur-config","owner":"opentable","description":"Configuration framework to help with large amount of configurations.","archived":false,"fork":false,"pushed_at":"2025-05-02T22:54:52.000Z","size":265,"stargazers_count":2,"open_issues_count":4,"forks_count":3,"subscribers_count":24,"default_branch":"main","last_synced_at":"2025-05-02T23:29:34.286Z","etag":null,"topics":["harness","harness-framework","nodejs","renovate","spur","spur-framework"],"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/opentable.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2014-12-05T17:50:37.000Z","updated_at":"2025-03-06T20:26:29.000Z","dependencies_parsed_at":"2024-02-01T18:55:28.436Z","dependency_job_id":"c4dc285c-e0c5-4f4f-b16d-f53eaac920a9","html_url":"https://github.com/opentable/spur-config","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Fspur-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Fspur-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Fspur-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Fspur-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opentable","download_url":"https://codeload.github.com/opentable/spur-config/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253809720,"owners_count":21967783,"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":["harness","harness-framework","nodejs","renovate","spur","spur-framework"],"created_at":"2024-11-30T17:27:41.474Z","updated_at":"2025-05-12T19:43:59.460Z","avatar_url":"https://github.com/opentable.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://opentable.github.io/spur/logos/Spur-Config.png?rand=1\" width=\"100%\" alt=\"Spur: Config\" /\u003e\n\nConfiguration framework to help manage complex application configurations in [Node.js](http://nodejs.org/).\n\n  [![NPM Version][npm-version-image]][npm-url]\n  [![NPM Install Size][npm-install-size-image]][npm-install-size-url]\n  [![NPM Downloads][npm-downloads-image]][npm-downloads-url]\n\n# About the Spur Framework\n\nThe Spur Framework is a collection of commonly used Node.JS libraries used to create common application types with shared libraries.\n\n[Visit NPMJS.org for a full list of Spur Framework libraries](https://www.npmjs.com/browse/keyword/spur-framework) \u003e\u003e\n\n# Topics\n\n- [Quick start](#quick-start)\n    - [Usage](#usage)\n      - [Configuration files](#configuration-files)\n      - [Standalone use](#standalone-use)\n      - [With spur-ioc auto-registration](#with-spur-ioc-auto-registration)\n- [Contributing](#contributing)\n- [License](#license)\n\n\n# Quick start\n\n## Installing\n\n`Standalone:`\n```shell\n$ npm install spur-config --save\n```\n\n`With dependency injection:`\n```shell\n$ npm install spur-ioc --save\n$ npm install spur-common --save\n$ npm install spur-config --save\n```\n\n## Usage\n\nSupports active Node versions in the [LTS Schedule](https://github.com/nodejs/LTS#lts-schedule). ([view current versions](.travis.yml))\n\n### Configuration files\n\n#### `src/config/default.js`\n\n```javascript\nmodule.exports = function () {\n\n  return this.properties({\n    environment: 'default',\n    port: 8080\n  });\n\n}\n```\n\n#### `src/config/shared-deployed.js`\n\n```javascript\nmodule.exports = function () {\n\n  return this.properties({\n    shared: {\n      someProp: 123\n    }\n  });\n\n}\n```\n\n#### `src/config/development.js` (default)\n\n```javascript\nmodule.exports = function () {\n\n  this.extends('default');\n\n  return this.properties({\n    environment: 'default'\n  });\n\n}\n```\n\n#### `src/config/production.js`\n\n```javascript\nmodule.exports = function () {\n\n  // Extend multiple files\n  this.extends('default', 'shared-deployed');\n\n  return this.properties({\n    environment: 'production',\n    port: process.env.PORT or 9000\n  });\n\n}\n```\n\n### `Standalone use`\n\nThis example shows how to manually load configuration into\n\n```javascript\nconst spurConfig = require('spur-config');\n\nconst configDirectory = path.join(__dirname, 'src/config');\n\n// load specific environment file\nconst config = SpurConfig.load(configDirectory, 'production');\n\n// loads configuration specified in NODE_ENV environment variable\nconst config = SpurConfig.load(configDirectory);\n```\n\n### `With spur-ioc auto-registration`\n\nThis example loads the configuration into an injector/module and makes it available as the `config` dependency.\n\n#### `src/injector.js`\n```javascript\nconst spur = require('spur-ioc');\nconst spurConfig = require('spur-config');\nconst registerConfig = require('spur-common/registerConfig');\n\nmodule.exports = function () {\n\n  const ioc = spur.create('test-application');\n  const configDirectory = path.join(__dirname, './config');\n\n  registerConfig(ioc, configDirectory);\n\n  return ioc;\n}\n```\n\n#### `src/services/TestConfig.js`\n\n```javascript\nmodule.exports = function (config) {\n\n  console.log(config);\n\n}\n```\n\n# Contributing\n\n## We accept pull requests\n\nPlease send in pull requests and they will be reviewed in a timely manner. Please review this [generic guide to submitting a good pull requests](https://github.com/blog/1943-how-to-write-the-perfect-pull-request). The only things we ask in addition are the following:\n\n * Please submit small pull requests\n * Provide a good description of the changes\n * Code changes must include tests\n * Be nice to each other in comments. :innocent:\n\n## Style guide\n\nThe majority of the settings are controlled using an [EditorConfig](.editorconfig) configuration file. To use it [please download a plugin](http://editorconfig.org/#download) for your editor of choice.\n\nIn addition we use **[ESLint](http://eslint.org/)** to enforce some of the JavaScript rules. To enable on your editor, please install one of the **[editor plugins](http://eslint.org/docs/user-guide/integrations#editors)**.\n\nIf your editor does not have ESLint integration, the test commands below will run them and fail your build.\n\n## All tests should pass\n\nExecute the following the install the dependencies, build and test with the following.\n\n```shell\n$ npm install\n$ npm test\n```\n\nView the `package.json`'s `scripts` section for a list of all the other commands.\n\n# License\n\n[MIT](LICENSE)\n\n[npm-downloads-image]: https://badgen.net/npm/dm/spur-config\n[npm-downloads-url]: https://npmcharts.com/compare/spur-config?minimal=true\n[npm-install-size-image]: https://badgen.net/packagephobia/install/spur-config\n[npm-install-size-url]: https://packagephobia.com/result?p=spur-config\n[npm-url]: https://npmjs.org/package/spur-config\n[npm-version-image]: https://badgen.net/npm/v/spur-config\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentable%2Fspur-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopentable%2Fspur-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentable%2Fspur-config/lists"}