deno-dotenv
deno-dotenv copied to clipboard
doesn't parse .env.local
import "https://deno.land/x/dotenv/load.ts"
this doesn't parse .env.local
Is that really an issue? I mean, people can have many different names for their env
files: .env.test
, .env.ci
and .env.local
and various different combinations — it is not really possible to predict them, and perhaps not worth trying
(I even think that this feature of automatic loading of the environment is unnecessary, as it disables you from doing the import in a controlled and configured way — but that perhaps is a different question)
@pasha-bolokhov I think that is a new convention building up in Node.js community, promoted by Vite. It would be great it this can be provided.
Idea: https://vitejs.dev/guide/env-and-mode.html#env-files
I think the original dotenv
has implemented this as well
Would be interesting to see how Node implemented it. I mean it's all straightforward except where do you get the current mode from?
Usually they get that from NODE_ENV
. Is this env used at all in Deno? I don't think it is necessary in Deno's context?
I've never seen it being used. But it's not that we can't use it. We can use NODE_ENV
just for the sake of getting the current running mode. Can also (in addition) use DENO_ENV
with a higher priority. How does that sound?
I've never seen it being used. But it's not that we can't use it. We can use
NODE_ENV
just for the sake of getting the current running mode. Can also (in addition) useDENO_ENV
with a higher priority. How does that sound?
That sounds good to me!
Just to mention, I did not notice it having been implemented in Node
. If anyone has, lemme know, it would be good to follow the same pattern. If they haven't, then we have a chance to be faster than them…
I think that is implemented in dotenv
of NPM already? But I am not sure where in their source.
It never mentions it in the docs, never found it
This is what they have on their docs page: https://github.com/motdotla/dotenv#should-i-have-multiple-env-files
So we need to make some consensus on whether or not or how to proceed…