@rapido/env
TypeScript icon, indicating that this package has built-in type declarations

0.0.29 • Public • Published

@rapido/env

This package includes modules to manage environment variables in Rapido apps.

Please refer to the Rapido documentation:

Installation

yarn add @rapido/env

Getting Started

// First initialize the env (e.g. during build process)
import initEnv from '@rapido/env/init';

// First initialize
initEnv({ NODE_ENV: 'development' });
// Later in code you can access env vars after the package has been initialized
import getEnv from '@rapido/env';

console.log(getEnv('NODE_ENV'));

API

initEnv(envars: { [key: string]: string }): void

Accepts an object of environment values and stores them for later.

import initEnv from '@rapido/env/init';

initEnv({ NODE_ENV: 'development' });

getEnv(key: string): string

Accepts a key string and returns the env variable value for that key.

import getEnv from '@rapido/env';

console.log(getEnv('NODE_ENV'));

Readme

Keywords

Package Sidebar

Install

npm i @rapido/env

Weekly Downloads

0

Version

0.0.29

License

MIT

Unpacked Size

4.01 kB

Total Files

7

Last publish

Collaborators

  • maxparelius