motdotla / dotenv

Loads environment variables from .env for nodejs projects.
https://www.dotenvx.com
BSD 2-Clause "Simplified" License
19.01k stars 853 forks source link

README: change intended location of .env file from project root to working directory #815

Closed stefanneuhaus closed 6 months ago

stefanneuhaus commented 6 months ago

Although this is correctly explained further down in the section on Config options, being not 100% correct in this "Hello World" example can cause unnecessary confusion in the first place.

motdotla commented 6 months ago

i understand. i'm just concerned this might cause more confusion for the typical path - which is root.

can you describe the situation you were in that it was confusing? was it a monorepo?

stefanneuhaus commented 6 months ago

I agree, having a simple introductory example is nice. In "my" case an undergraduate of mine spent hours analyzing the issue for her project with a project structure like backend/app.js. This might be an unusual structure, but still. Maybe there is a better phrase that is both simple and less misleading in those cases.

motdotla commented 6 months ago

can you change the text to something like:

...eate a `.env` file in the root of your project. (if using a monorepo structure like `apps/backend/app.js`, you should put in the root of your backend folder where your app.js process runs)
stefanneuhaus commented 6 months ago

I updated the text accordingly.

motdotla commented 6 months ago

thanks!