{"id":20471880,"url":"https://github.com/signiant/serverless-node-config-plugin","last_synced_at":"2025-03-05T13:45:38.863Z","repository":{"id":69123010,"uuid":"71150092","full_name":"Signiant/serverless-node-config-plugin","owner":"Signiant","description":"Uses node-config to load a configuration file during serverless deployment","archived":false,"fork":false,"pushed_at":"2016-10-17T15:36:35.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-16T02:24:24.497Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Signiant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2016-10-17T14:57:44.000Z","updated_at":"2017-10-17T16:52:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"6b5caaa1-c889-4887-ae33-dd214d19ef46","html_url":"https://github.com/Signiant/serverless-node-config-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fserverless-node-config-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fserverless-node-config-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fserverless-node-config-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fserverless-node-config-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Signiant","download_url":"https://codeload.github.com/Signiant/serverless-node-config-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242039610,"owners_count":20061925,"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":[],"created_at":"2024-11-15T14:17:29.353Z","updated_at":"2025-03-05T13:45:38.858Z","avatar_url":"https://github.com/Signiant.png","language":"JavaScript","readme":"# Serverless Node Config Plugin\n\n[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)\nA Serverless v1.0 plugin to pre-compile a [node-config](https://github.com/lorenwest/node-config) \nconfiguration and include it in a deployment package.\n\n\n## Install\n\n*Until published to NPM*\nInstall plugin\n```\nnpm install --save-dev Signiant/serverless-node-config-plugin\n```\n\nAdd the plugin to your `serverless.yml` file:\n\n```yaml\nplugins:\n  - serverless-node-config-plugin\n```\n\n## Configure\n\n### Node Config Environment Variables\n\nNode config determines which configuration files to read and merge\nby looking at specific environment variables. [More info here](https://github.com/lorenwest/node-config/wiki/Configuration-Files)\n\nThis plugin uses node-config to load the configuration at serverless\ndeploy time. Therefore any relevant environment variables present will\ndetermine which config files are loaded.\n\nFor example, the following will merge and generate a config file from source files\n`default`, `development`, `development-a`\n```\nbash-3.2$ export NODE_ENV='development'\nbash-3.2$ export NODE_APP_INSTANCE='a'\nbash-3.2$ serverless deploy\n```\n\nYou can also set the node-config specific environment variables in the\ncustom section of `serverless.yaml`\n\n```yaml\ncustom:\n  nodeConfigNodeEnv: development\n  nodeConfigHostname: ${opt:stage, self:provider.stage}\n  nodeConfigAppInstance: a\n```\n\n### Temporary Working Directory\n\nBy default the plugin will create a temporary working directory called\n`.node-config` with the working directory. It will copy the service\ncontents here before modifying them, and will delete the directory when\ncompleted.\nThis can be over-ridden by setting the `nodeConfigTmpDir` custom variable.\n\n```yaml\ncustom:\n  nodeConfigTmpDir: ./myTmpDir\n```\n\n## Usage\n\nYour project must include the node-config project\n```\nnpm install --save node-config\n```\n\nFrom here you can just use the node-config project as designed.\n```\nlet config = require('config')\n```\n\nWhen deployed, the config module will be replaced with a pre-compiled\nconfiguration based on the environment variables present at deploy-time.\n\n\n## Known Issues\n\n* This plugin does not work with other plugins that manipulate files\nduring the `createDeploymentArtifacts` phase of the serverless deploy.\nFor example [serverless-webpack](https://github.com/elastic-coders/serverless-webpack)\n\n\n## Todo\n\n* NPM publish\n* Play nicely with other packaging plugins (e.g. serverless-webpack)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigniant%2Fserverless-node-config-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsigniant%2Fserverless-node-config-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigniant%2Fserverless-node-config-plugin/lists"}