You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.
First off, I like how easy it is with this package to import .env values into my project. However, I've noticed in my test projects, I'll would like it if true/false are parsed as boolean, numbers are correctly parsed, empty values are null or undefined instead of an empty string.
Right now I add the following code to my projects:
Hi there! Thanks for the kind words. Apologies for the delayed reply.
This is an interesting idea and something people have mentioned before.
The tricky thing to get around is that as far as the shell is concerned environment variables are always strings. Deno.env.set respects this and will error if given anything but a string. So the export option of config would be incompatible with the parseTypes option. I'd rather keep things consistent between how config() returns variables and how Deno.env.get returns variables.
However, if you'd like to publish a helper module with what you have (similar to dotenv-expand) I'd be happy to include it in the docs.
I understand why you would like to stay true to the environment variables by keeping everyting as strings. I'll take a look in creating a helper module myself. Maybe adding something like getEnv('ENV_NAME', 'default value') or other small features as well.
Hi,
First off, I like how easy it is with this package to import .env values into my project. However, I've noticed in my test projects, I'll would like it if true/false are parsed as boolean, numbers are correctly parsed, empty values are null or undefined instead of an empty string.
Right now I add the following code to my projects:
How would you look at the idea of implementing this something along the line of:
The text was updated successfully, but these errors were encountered: