https://github.com/CourseDesign/conev-source-process-env
conev-source-process-env is an implementation of conev's source to get configuration from process.env.
https://github.com/CourseDesign/conev-source-process-env
conev configuration environment-variables npm npm-package process-env
Last synced: 11 months ago
JSON representation
conev-source-process-env is an implementation of conev's source to get configuration from process.env.
- Host: GitHub
- URL: https://github.com/CourseDesign/conev-source-process-env
- Owner: CourseDesign
- Created: 2020-03-21T08:08:28.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T05:02:36.000Z (almost 3 years ago)
- Last Synced: 2024-10-14T08:10:52.993Z (over 1 year ago)
- Topics: conev, configuration, environment-variables, npm, npm-package, process-env
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/conev-source-process-env
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# conev-source-process-env
conev-source-process-env is an implementation of conev's source to get configuration from process.env.

## Install
```shell
# 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.
```typescript
import { ConfigBuilder } from 'conev';
import ProcessEnvSource from 'conev-source-process-env';
```
And create Source and set up.
```typescript
const processEnvSource = new ProcessEnvSource(/* env */);
```
Create ConfigBuilder and set Environment, add source. (highest priority is added first).
```typescript
const builder = new ConfigBuilder();
builder
.setEnv('dev', 'basic')
.addSource(processEnvSource);
```
Build configuration
```typescript
const config = await builder.build(); // This is the result of combining dev and basic.
```
Use configuration
```typescript
config.get() // The whole configuration created comes out
config.get('PATH'); // Is same as config.get().PATH
```
## Process Env Source
```typescript
class ProcessEnvSource {
constructor(env?: string);
export(): Promise>;
}
```
`ProcessEnvSource` defines the source from process.env.