0.1.1 • Published 3 years ago

@bergerapi/env v0.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

env

install size

Simple dotenv clone with extended functionality.

Usage

Installation

With NPM

npm i @bergerapi/env

With Yarn

yarn add @bergerapi/env

Implementation

Create an .env file in your project directory.

TEST=test_string123

Then add following code to your entry file (e.g. index.ts)

import { env } from "@bergerapi/env";

env();

And use a variable with

console.log(process.env.TEST);

Configuration

@bergerapi/env allows you to change the file which it will parse by passing the path as a parameter to the env() function.

env("../postgres.env")

You can also call this function multiple times to use multiple .env files as long as they do not contain variables whose names collide with other variables already defined.

0.1.1

3 years ago

0.1.0

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago