1.1.6 • Published 10 months ago

rapidenv v1.1.6

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
10 months ago

rapidenv

RapidEnv is a zero-dependency library for managing environment variables in Node.js.

Installation

npm install rapidenv

Usage

const env = require('rapidenv')();

env.load(); // Loads the environment variables from the .env file
env.setVariable('TEST', 'hello'); // Sets the TEST variable to hello
env.deleteVariable('TEST'); // Deletes the TEST variable

Comments

# This is a comment

TEST="hello" # This is also a comment

Multiline Values

KEY="---- BEGIN MY KEY ----

...
hello
...

---- END MY KEY ----"

Parsing

const env = require('rapidenv')();

console.log(env.parseVariables()) // { TEST: 'hello' }

Custom .env Path

const env = require('rapidenv')("./src/.env" /* Path to .env file */);

env.load();
1.1.0

10 months ago

1.1.6

10 months ago

1.0.6

11 months ago

1.1.4

10 months ago

1.0.5

11 months ago

1.1.2

10 months ago

1.0.3

11 months ago

1.0.2

1 year ago

1.0.0

1 year ago