{"repo":"motdotla/dotenv","free":true,"listed":false,"github":"https://github.com/motdotla/dotenv","clone":"git clone https://github.com/motdotla/dotenv.git","description":"Loads environment variables from .env for nodejs projects.","language":"JavaScript","stars":20519,"topics":["dotenv","environment-variables","javascript","node","nodejs","secrets","secret-management","secret-manager","security-tools","configuration-file"],"license":"BSD-2-Clause","category":"dev-tools","readme_excerpt":"If you like dotenv, you will probably love dotenvx – for encrypting .env files. Thank you for using dotenv. 🙏 dotenv Dotenv is a zero-dependency module that loads environment variables from a .env file into process.env . Storing configuration in the environment separate from code is based on The Twelve-Factor App methodology. Watch the tutorial &nbsp; Usage Install it. Create a .env file in the root of your project: As early as possible in your application, import and configure dotenv: That's it. process.env now has the keys and values you defined in your .env file. &nbsp; Advanced ES6 Import with ES6: DOTENV CONFIG ENCODING , DOTENV CONFIG PATH , DOTENV CONFIG QUIET , DOTENV CONFIG DEBUG , DOTENV CONFIG OVERRIDE , DOTENV CONFIG SECURE , and DOTENV CONFIG FAST provide defaults for config() and dotenv run . Options/flags passed directly take precedence. bun yarn pnpm deno Monorepos For monorepos with a structure like apps/backend/app.js , put it the .env file in the root of the folder where your app.js process runs. Multiline Values If you need multiline variables, for example private keys, those are now supported ( = v15.0.0 ) with line breaks: Alternatively, you can double quote strings and use the \\n character: Comments Comments may be added to your file on their own line or inline: Comments begin where a # exists, so if your value contains a # please wrap it in quotes. This is a breaking change from = v15.0.0 and on. Parsing The engine which parses the contents of your fi","default_branch":null,"files":null,"tree":[],"storefront":"/r/motdotla","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/motdotla/dotenv/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}