env-src

0.2.1 • Public • Published

env-src

Set environment variables from various sources.

Installation

npm i env-src

Usage

import { envSrc } from 'env-src';
 
await envSrc([
  {
    json: {
      path: 'path/to/env.json',
    },
  },
  {
    ssm: {
      path: '/my-app',
      recursive: true,
      withDecryption: true,
    },
  },
];

envSrc(options)

  • options
    • An object of source definitions, or an array of the one.

The object of source definitions has the following keys:

  • json
    • This key means that a json file is loaded as source.
    • The value is specified an object that has the following properties:
      • path - A path of the json file.
  • ssm
    • This key means that environment variables are defined in AWS SSM Parameter Store.
    • The value is specified an object that has the following properties:
      • path - A path to obtain parameters.
      • recursive - A boolean value that determines whether to obtain parameters recursively.
      • withDecryption - If this is true, values of secure strings are decrypted.

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i env-src

Weekly Downloads

8

Version

0.2.1

License

MIT

Unpacked Size

4.28 kB

Total Files

4

Last publish

Collaborators

  • nak2k