# Package @google-cloud/rcloadenv (4.0.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [4.0.0 (latest)](https://docs.cloud.google.com/nodejs/docs/reference/rcloadenv/latest/overview)
- [3.0.1](https://docs.cloud.google.com/nodejs/docs/reference/rcloadenv/3.0.1/overview)
- [2.1.1](https://docs.cloud.google.com/nodejs/docs/reference/rcloadenv/2.1.1/overview)

## Interfaces

### [RCLoadEnvOptions](https://docs.cloud.google.com/nodejs/docs/reference/rcloadenv/latest/rcloadenv/rcloadenvoptions)

### [TransformOptions](https://docs.cloud.google.com/nodejs/docs/reference/rcloadenv/latest/rcloadenv/transformoptions)

### [Variable](https://docs.cloud.google.com/nodejs/docs/reference/rcloadenv/latest/rcloadenv/variable)

## Functions

### apply(variables, env, opts)

    export declare function apply(variables: Variable[], env?: NodeJS.ProcessEnv, opts?: {}): NodeJS.ProcessEnv;

Applies the provided raw variables to the given object.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `variables` | `https://docs.cloud.google.com/nodejs/docs/reference/rcloadenv/latest/rcloadenv/variable[]` |
| `env` | `NodeJS.ProcessEnv` |
| `opts` | `{}` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `NodeJS.ProcessEnv` |   |

### getAndApply(configName, env, opts)

    export declare function getAndApply(configName: string, env?: NodeJS.ProcessEnv, opts?: RCLoadEnvOptions): Promise

Retrieves all variables in the given config and mixes them into the given object.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `configName` | `string` |
| `env` | `NodeJS.ProcessEnv` |
| `opts` | `https://docs.cloud.google.com/nodejs/docs/reference/rcloadenv/latest/rcloadenv/rcloadenvoptions` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<"\"process\"".__global.NodeJS.ProcessEnv>` | {Promise} |

### getVariables(configName, opts)

    export declare function getVariables(configName: string, opts?: RCLoadEnvOptions): Promise

Retrieves all variables in the given config.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `configName` | `string` |
| `opts` | `https://docs.cloud.google.com/nodejs/docs/reference/rcloadenv/latest/rcloadenv/rcloadenvoptions` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<https://docs.cloud.google.com/nodejs/docs/reference/rcloadenv/latest/rcloadenv/variable[]>` | {Promise} |

### transform(variables, oldEnv, opts)

    export declare function transform(variables: Variable[], oldEnv?: NodeJS.ProcessEnv, opts?: TransformOptions): NodeJS.ProcessEnv;

Transforms the given array of raw variables into a simple key-value object.

In: \[{name:"...",value:"..."}, ...\] Out: { VAR1: "...", VAR2: "...", ... }

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `variables` | `https://docs.cloud.google.com/nodejs/docs/reference/rcloadenv/latest/rcloadenv/variable[]` |
| `oldEnv` | `NodeJS.ProcessEnv` |
| `opts` | `https://docs.cloud.google.com/nodejs/docs/reference/rcloadenv/latest/rcloadenv/transformoptions` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `NodeJS.ProcessEnv` |   |