Skip to content

Repository files navigation

conev-source-process-env

conev-source-process-env is an implementation of conev's source to get configuration from process.env.

Install

# with npm 
npm install conev-source-process-env
# or with Yarn 
yarn add conev-source-process-env

Usage

Get ConfigBuilder from conev and Sources to use.

import{ConfigBuilder}from'conev';importProcessEnvSourcefrom'conev-source-process-env';

And create Source and set up.

constprocessEnvSource=newProcessEnvSource(/* env */);

Create ConfigBuilder and set Environment, add source. (highest priority is added first).

constbuilder=newConfigBuilder();builder.setEnv('dev','basic').addSource(processEnvSource);

Build configuration

constconfig=awaitbuilder.build();// This is the result of combining dev and basic.

Use configuration

config.get()// The whole configuration created comes outconfig.get('PATH');// Is same as config.get().PATH

Process Env Source

classProcessEnvSource{constructor(env?: string);export(): Promise<Map<string,object>>;}

ProcessEnvSource defines the source from process.env. ​

About

conev-source-process-env is an implementation of conev's source to get configuration from process.env.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages