NodeJsEnvironment Variables

Environment variables store configuration data outside of your code, such as database URLs or API keys. Use the 'dotenv' package to load variables from a .env file into your application.

npm install dotenv

// .env file
PORT=3000

// index.js
require('dotenv').config();
console.log(process.env.PORT);