dotenv-variable add a .env file. add below format of code. isProduction: true production: port: 7000 dev: port: 8000 import const dep=require("dot-env-plus"); you can access values from config return or process.env; const {port}=dep.config(); console.log(port); dep.config(); console.log(process.env.port);