rapidenv
TypeScript icon, indicating that this package has built-in type declarations

1.1.6 • Public • Published

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();

Package Sidebar

Install

npm i rapidenv

Weekly Downloads

1

Version

1.1.6

License

GPL-3.0

Unpacked Size

41.8 kB

Total Files

6

Last publish

Collaborators

  • hanzydev