Skip to content

Commit

Permalink
Reformat readme
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisandrews7 committed Jun 8, 2019
1 parent ce40837 commit 97b7388
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions README.md
Expand Up @@ -11,7 +11,6 @@ npm install middy-env
```

The specified environment variables will be parsed and passed into the handler.
By default parameters are assigned to the function handler's `context` object. They can instead be assigned to the Node.js `process.env` object by setting the `setToContext` flag to `false`.

## Options

Expand All @@ -20,9 +19,16 @@ By default parameters are assigned to the function handler's `context` object. T
- `setToContext` (boolean) (optional): This will assign the parsed values to the `context` object
of the function handler rather than to `process.env`. Defaults to `true`
- `values` (object) (required): Map of environment variables to parse, where the key is the destination.
Either provide just the environment variable key. Or provide the key, type and fallback value e.g. `['KEY', 'string', 'fallbackValue']`.
The following types are supported: `string`, `int`, `float`, `bool`.
If no fallback value is provided a [ReferenceError](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) will be thrown.
Either provide just the environment variable key. Or provide the key, type and fallback value e.g. `['KEY', 'string', 'fallbackValue']`.

By default parameters are assigned to the function handler's `context` object. They can instead be assigned to the Node.js `process.env` object by setting the `setToContext` flag to `false`.
If no fallback value is provided a [ReferenceError](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) will be thrown if an environment variable is undefined.

## Supported Types
- `string`
- `int`
- `float`
- `bool`

## Usage

Expand Down

0 comments on commit 97b7388

Please sign in to comment.