I saw this expression:
require('dotenv').config();
At the beginning of a server.js
file within a NodeJS project. I am just curious to know how does it work and what does it do?
Because almost always I have seen a variable before the require
expression line like
const express = require('express');
and afterwards it will be used somehow like
const app = express();
But require('dotenv').config();
looks different and it hasn't been used like the common approach.