Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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;
Comment

npm dotenv

npm install dotenv
npx nodemon -r dotenv/config server.js
Comment

import npm dotenv package

require('dotenv').config()
console.log(process.env.PATH)
Comment

PREVIOUS NEXT
Code Example
Javascript :: react tailwind loading 
Javascript :: javascript read word document 
Javascript :: js get first and last day of previous month 
Javascript :: emitting event on socket.io using async await 
Javascript :: tricky javascript interview questions 
Javascript :: chrome.runtime.sendMessage 
Javascript :: express route parameters 
Javascript :: How to return arguments in an array in javascript 
Javascript :: enable swipe using javascript 
Javascript :: redux saga use navigation 
Javascript :: regex look behind 
Javascript :: how can you set an environment variable in node 
Javascript :: react protected route 
Javascript :: Using flat() method 
Javascript :: import javascript 
Javascript :: remove object from array of object 
Javascript :: addeventlistener classlist toggle dom 
Javascript :: Object.Values () javascript 
Javascript :: javascript days until end of month 
Javascript :: how to create an array in javascript 
Javascript :: es6 concat array 
Javascript :: get width of screen 
Javascript :: how to check if email already exists in database using javascript 
Javascript :: javascript iterate through an object 
Javascript :: infinite scroll for chat react js 
Javascript :: start live server react js 
Javascript :: how to change version of npm 
Javascript :: react-navigation 
Javascript :: console.log(...) is not a function 
Javascript :: removing duplicates from array javascript 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =