Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

How does this expression work? "require('dotenv').config();"

$
0
0

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.


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>