1.0.9 • Published 6 days ago

tej-env v1.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
6 days ago

Tej-Env

A zero-dependency module to load environment variables in your Nodejs project.

🧐 Features

  • Load environment variables and access them anywhere with process.env or our global variable TejEnv
  • Ability to set environment variables to access them anytime anywhere within that application session. (This doesn't update .env file)
  • UPCOMING - Optionally update .env file on the go with in-built routes for express.js and te.js

🛠️ Install

npm install tej-env

🧑🏻‍💻 Basic Usage

import "tej-env"

// To read an environment variable anywhere in your project:
const value = process.env.YOUR_VARIABLE_NAME;

🧑🏻‍💻 Advanced Usage

tej-env module can be used to set and unset variables at global level. This will not update the .env file yet. Updating env file is a work in progress. Import required functions from tej-env module and use them as shown below:

import { env, setEnv, unsetEnv} from 'tej-env'

There are 2 options to read an environment variable or global variable anywhere in your project: Option 1: Using process.env

const value = process.env.YOUR_VARIABLE_NAME;

Option 2: Using env() function from tej-env

const data = env("YOUR_VARIABLE_NAME");
setEnv(key, value);
unsetEnv(key, value);

🍰 Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

❤️ Support

A simple star to this project repo is enough to keep me motivated on this project for days. If you find your self very much excited with this project let me know with a star.

🙇 Author

Hirak Chhatbar

➤ License

Distributed under the MIT License. See LICENSE for more information.

1.0.9

6 days ago

1.0.8

6 days ago

1.0.7

6 days ago

1.0.6

14 days ago

1.0.5

25 days ago

1.0.3

25 days ago

1.0.2

27 days ago

1.0.1

27 days ago

1.0.0

29 days ago