Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

npm dotenv

//In CMD
// npm i dotenv

//in JS file 
const env = require('dotenv');

const app = express();
env.config({
    path: './config/.env'
});

//use 
const PORT = process.env.PORT;
Source by www.npmjs.com #
 
PREVIOUS NEXT
Tagged: #npm #dotenv
ADD COMMENT
Topic
Name
8+6 =