{"id":22083772,"url":"https://github.com/unlyed/serverless-scripts-env-plugin","last_synced_at":"2025-03-23T21:26:43.406Z","repository":{"id":115854483,"uuid":"166125304","full_name":"UnlyEd/serverless-scripts-env-plugin","owner":"UnlyEd","description":null,"archived":false,"fork":false,"pushed_at":"2020-03-09T23:45:28.000Z","size":838,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-01T09:48:48.864Z","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/UnlyEd.png","metadata":{"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-01-16T23:03:16.000Z","updated_at":"2020-03-09T23:45:37.000Z","dependencies_parsed_at":"2023-07-21T21:32:54.104Z","dependency_job_id":null,"html_url":"https://github.com/UnlyEd/serverless-scripts-env-plugin","commit_stats":null,"previous_names":["unlyed/serverless-next-scripts"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnlyEd%2Fserverless-scripts-env-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnlyEd%2Fserverless-scripts-env-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnlyEd%2Fserverless-scripts-env-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnlyEd%2Fserverless-scripts-env-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UnlyEd","download_url":"https://codeload.github.com/UnlyEd/serverless-scripts-env-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244566948,"owners_count":20473451,"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-12-01T00:17:38.430Z","updated_at":"2025-03-23T21:26:43.384Z","avatar_url":"https://github.com/UnlyEd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://unly.org\"\u003e\u003cimg src=\"https://storage.googleapis.com/unly/images/ICON_UNLY.png\" align=\"right\" height=\"20\" alt=\"Unly logo\" title=\"Unly logo\" /\u003e\u003c/a\u003e\n[![Build Status](https://travis-ci.com/UnlyEd/serverless-scripts-env.svg?branch=master)](https://travis-ci.com/UnlyEd/serverless-scripts-env)\n[![Maintainability](https://api.codeclimate.com/v1/badges/66de5557a98caaedd4c3/maintainability)](https://codeclimate.com/github/UnlyEd/serverless-scripts-env/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/66de5557a98caaedd4c3/test_coverage)](https://codeclimate.com/github/UnlyEd/serverless-scripts-env/test_coverage)\n[![Known Vulnerabilities](https://snyk.io/test/github/UnlyEd/serverless-scripts-env-plugin/badge.svg?targetFile=package.json)](https://snyk.io/test/github/UnlyEd/serverless-scripts-env-plugin?targetFile=package.json)\n\n# Serverless Scripts Env\n\n## Introduction\n\nThis plugin aims to answer a specific need and to simplify the assignment of environment variables with serverless either front-end or back-end.\n\n\u003c!-- toc --\u003e\n\n- [Installation](#installation)\n- [Usage](#usage)\n  * [Step 1: Load the Plugin](#step-1-load-the-plugin)\n  * [Step 2: Configure your `serverless.yml`](#step-2-configure-your-serverlessyml)\n- [Configuration of `slsScripts` object:](#configuration-of-slsscripts-object)\n    + [`offline` \u0026 `build` object:](#offline--build-object)\n  * [Try it out yourself](#try-it-out-yourself)\n- [API](#api)\n- [Contributing](#contributing)\n  * [Getting started](#getting-started)\n  * [Test](#test)\n  * [Releasing and publishing](#releasing-and-publishing)\n- [Node support](#node-support)\n- [License](#license)\n- [Vulnerability disclosure](#vulnerability-disclosure)\n- [Contributors and maintainers](#contributors-and-maintainers)\n- [**[ABOUT UNLY]**](#about-unly-)\n\n\u003c!-- tocstop --\u003e\n\n## Installation\n\nInstall the plugin using either Yarn or NPM. (we use Yarn)\n\nNPM:\n```bash\nnpm install @unly/serverless-scripts-env\n```\n\nYARN:\n```bash\nyarn add @unly/serverless-scripts-env\n```\n\n## Usage\n\n### Step 1: Load the Plugin\n\nThe plugin determines your environment during deployment and adds all environment variables to your Lambda function.\nAll you need to do is to load the plugin:\n\n\u003e Must be declared **before** `serverless-webpack`, despite what their officially doc says\n\n```yaml\nplugins:\n  - '@unly/serverless-scripts-env' # Must be first, even before \"serverless-webpack\", see https://github.com/UnlyEd/serverless-scripts-env\n  - serverless-webpack # Must be second, see https://github.com/99xt/serverless-dynamodb-local#using-with-serverless-offline-and-serverless-webpack-plugin\n```\n\n### Step 2: Configure your `serverless.yml`\n\nSet the `slsScripts` object configuration as follows (list of all available options below):\n\n```yaml\ncustom:\n  slsScripts:\n    offline:\n      logName: client # name of the command that appears in the terminal being executed\n      script:\n        cmd: next # command to execute\n        args:\n          - -p 3001\n      path: # Absolute path to run the command by default take root folder\n      env:\n        exclude: # list of environment variables present that will not be provided at launch time in the child process\n          - SECRET_KEY\n\nprovider:\n  name: aws\n  runtime: nodejs6.10\n  environment:\n    GROUP_NAME: staging\n    SECRET_KEY: f08ed2dc-edeb-45f4-9cac-56012820a384\n```\n\n## Configuration of `slsScripts` object:\n\n| Attributes |  Type  | Required | Description                                                      |\n|------------|:------:|:--------:|------------------------------------------------------------------|\n| offline    | Object |   false  | script to run before cli serverless-offline start                |\n| build      | Object |   false  | script to run before cli serverless deploy or serverless package |\n\n#### `offline` \u0026 `build` object:\n\n| Attributes |  Type  | Required | Default                   | Description                                                     |\n|------------|:------:|----------|---------------------------|-----------------------------------------------------------------|\n| logName    | String |   false  | Serverless-scripts-env    | name of the command that appears in the terminal being executed |\n| script     | Object |   true   |                           |                                                                 |\n| path       | String |   false  | current working directory | Absolute Path to run the script                                 |\n| env        | Object |   false  |                           |                                                                 |\n\n##### `script` object :\n\n| Attributes |  Type  | Required | Default | Description                  |\n|------------|:------:|----------|:-------:|------------------------------|\n| cmd        | String |   true   |         | command to execute           |\n| args       |  Array of String |   false  |   [ ]   | command arguments to execute |\n\n##### `env` object :\n\n| Attributes |       Type      | Required | Default | Description                        |\n|------------|:---------------:|----------|---------|------------------------------------|\n| exclude    | Array of String |   false  |         | environment variables to blacklist |\n\n\n### Try it out yourself\n\nTo test this plugin, you can clone this repository.\nGo to `examples/`, and follow the README.\n\n---\n\n## API\n\n[API](./API.md)\n\n---\n\n## Contributing\n\nWe gladly accept PRs, but please open an issue first so we can discuss it beforehand.\n\n### Getting started\n\n```\nyarn start # Shortcut - Runs linter + tests in concurrent mode (watch mode)\n\nOR run each process separately for finer control\n\nyarn lint\nyarn test\n```\n\n### Test\n\n```\nyarn test # Run all tests, interactive and watch mode\nyarn test:once\nyarn test:coverage\n```\n\n### Releasing and publishing\n\n```\nyarn releaseAndPublish # Shortcut - Will prompt for bump version, commit, create git tag, push commit/tag and publish to NPM\n\nyarn release # Will prompt for bump version, commit, create git tag, push commit/tag\nnpm publish # Will publish to NPM\n```\n\n## Node support\n\nThis plugin officially supports Node.js **6.10** and **8.10**.\n\n## License\n\nMIT\n\n# Vulnerability disclosure\n\n[See our policy](https://github.com/UnlyEd/Unly).\n\n---\n\n# Contributors and maintainers\n\nThis project is being maintained by:\n- [Unly] Ambroise Dhenain ([Vadorequest](https://github.com/vadorequest)) **(active)**\n\nThanks to our contributors:\n- Anthony Troupenat ([Fukoyamashisu](https://github.com/Fukoyamashisu))\n\n---\n\n# **[ABOUT UNLY]** \u003ca href=\"https://unly.org\"\u003e\u003cimg src=\"https://storage.googleapis.com/unly/images/ICON_UNLY.png\" height=\"40\" align=\"right\" alt=\"Unly logo\" title=\"Unly logo\" /\u003e\u003c/a\u003e\n\n\u003e [Unly](https://unly.org) is a socially responsible company, fighting inequality and facilitating access to higher education. \n\u003e Unly is committed to making education more inclusive, through responsible funding for students. \nWe provide technological solutions to help students find the necessary funding for their studies. \n\nWe proudly participate in many TechForGood initiatives. To support and learn more about our actions to make education accessible, visit : \n- https://twitter.com/UnlyEd\n- https://www.facebook.com/UnlyEd/\n- https://www.linkedin.com/company/unly\n- [Interested to work with us?](https://jobs.zenploy.io/unly/about)\n\nTech tips and tricks from our CTO on our [Medium page](https://medium.com/unly-org/tech/home)!\n\n#TECHFORGOOD #EDUCATIONFORALL\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funlyed%2Fserverless-scripts-env-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funlyed%2Fserverless-scripts-env-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funlyed%2Fserverless-scripts-env-plugin/lists"}