Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

serverless-plugin-stringify-variables

Serverless plugin that stringifies nested environment variables.

Why use it?

Serverless by default doesn't allow environment variables to be nested objects. If you want to group your variables, or have more complex data srtructures for various stages, this helps to organise them in a meaningful way.

How it works

You can use objects as environment variables:

{
  "COMPLEX_VARIABLE": {
    "url": "url",
    "database_name": "name"
  },
  "STRAIGHTFORWARD_VARIABLE": "just a normal value"
}

They will get stringified before deployment, and you can then require them in your code:

const COMPLEX_VARIABLE = json.parse(process.env.COMPLEX_VARIABLE);
const STRAIGHTFORWARD_VARIABLE = process.env.STRAIGHTFORWARD_VARIABLE;

About

Serverless plugin to stringify nested environment variables [public]

Topics

Resources

Stars

0 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages