@connected-home/serverless-plugin-stringify-variables
Serverless plugin to stringify nested environment variables
Last updated 3 years ago by lithin .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @connected-home/serverless-plugin-stringify-variables 
SYNC missed versions from official npm registry.

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;

Current Tags

  • 1.0.1                                ...           latest (3 years ago)

2 Versions

  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |