Skip to content

Instantly share code, notes, and snippets.

@wilmoore
Last active September 16, 2024 20:32
Show Gist options
  • Select an option

  • Save wilmoore/36088734958ee84f509e7d8820086b74 to your computer and use it in GitHub Desktop.

Select an option

Save wilmoore/36088734958ee84f509e7d8820086b74 to your computer and use it in GitHub Desktop.
Software Engineering :: Programming :: Languages :: JavaScript :: Runtimes :: Node.js :: Environment Variables :: --env-file=.env

Software Engineering :: Programming :: Languages :: JavaScript :: Runtimes :: Node.js :: Environment Variables :: --env-file=.env

⪼ Made with 💜 by realpolyglot.com

reference
related

Native Support for .env: Starting from Node.js v20.6.0, Node.js supports .env files for configuring environment variables.

Your configuration file should follow the INI file format, with each line containing a key-value pair for an environment variable. To initialize your Node.js application with predefined configurations, use the following CLI command:

node --env-file=.env index.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment