env-tracking
v1.1.5
Published
Load, create or update environment variables from .env file
Downloads
36
Readme
Installation
npm install env-tracking
Usage
Create a .env
file in the root of your project:
SECRET_KEY="YOUR_SECRET_KEY"
SECRET_HASH="YOUR_SECRET_HASH"
then import and use it in your application. CommonJS
const env = require("env-tracking").default;
ES module
import env from "env-tracking";
Example
Get
Getting value from .env file
const key = env.get("SECRET_KEY");
console.log(key); // YOUR_SECRET_KEY
Set
Set value to .env file, and you can make more than one
env.set(
[
{ key: "SECRET_KEY", value: "YOUR_SECRET_KEY" },
{ key: "SECRET_HASH", value: "YOUR_SECRET_HASH" }
], "./../.env" // path of .env file include filename
);