get environment variables in node js

process.env This is the standard way to access environment variables in Node.js. These variables are accessible through the process.env object. You can simply access the desired environment variable by using process.env.ENV_VARIABLE_NAME, where ENV_VARIABLE_NAME is the name of the environment variable you want to access. For example, to access an environment variable named PORT, you would use process.env.PORT to retrieve its value.