Using Environment Variables In Node.js 20.6.0
With the current release of version 20.6.0, Node.js now has integrated aid for .env files. You can now load environment variables from a .env file into process.env in your Node.js utility completely dependency-unfastened.
Loading an .env file is now as easy as:
node --env-file .env