-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Would be amazing if this could configure enviroment variables as well #12
Comments
Thank you @khrome83 for the suggestion, I will soon add support for configuring env variables as well as loading them from |
Yeah, I was thinking about this last night. Being able to specify loading from There are 3-4 third party mods that take care of .env files, but they either always assume |
Agreed specifying it in code does defeat the purpose. I'm wondering what naming would be better for loading env file and specifying env variables in deno-workspace scripts:
start:
file: main.ts
env_file: ./.env
env:
PORT: 80
DOMAIN: "example.net" OR scripts:
start:
file: main.ts
env: ./.env
env_vars:
PORT: 80
DOMAIN: "example.net" OR I think this may be best as to clearly define what the value should be scripts:
start:
file: main.ts
env_file: ./.env
env_vars:
PORT: 80
DOMAIN: "example.net" |
I am fine with the last one. I can also see something like this - scripts:
start:
file: main.ts
env:
file: ./.env
vars:
PORT: 80
DOMAIN: "example.net" I think this should also allow the global layer, like you do with permissions. Optionally, would you use a file and the vars at the same time? In other words if the YAML parsed as a string vs a object, you could handle it different. Parse as a object, no need for a filescripts:
start:
file: main.ts
env:
PORT: 80
DOMAIN: "example.net" Parses as a string, going to diskscripts:
start:
file: main.ts
env: ./.env |
Which module will you be using for the environment variable file read? I'm assuming dotenv? |
Yeah, that was my thought.
…---
Zane Milakovic
On Jun 15, 2020, 10:56 AM -0500, Ryan ***@***.***>, wrote:
Which module will you be using for the environment variable file read? I'm assuming dotenv?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
It was always the defacto package I would turn to. I'd like to see support for inline scripts in denox and env variable support would be an important component. |
Issue Type
Possible Solutions
Then it would add the variables to Deno using Deno.env.set('NAME', 'VALUE')
Then we can access it via Deno.env.get("NAME")
It would require
--allow-env
to be set.The text was updated successfully, but these errors were encountered: