deno-dotenv icon indicating copy to clipboard operation
deno-dotenv copied to clipboard

Async version of "config()"

Open pasha-bolokhov opened this issue 2 years ago • 3 comments

In other words, to use readFile() instead of readFileSync()… That will make the whole thing async of course… So maybe make two versions config() and configSync()

pasha-bolokhov avatar Oct 22 '21 16:10 pasha-bolokhov

@pasha-bolokhov For now someone kindly implemented configAsync. It's been released with v3.1.0.

Obviously eventually it would be good to migrate this to config and rename the existing config to configSync.

I'll reopen this ticket to gauge interest on fixing the naming.

pietvanzoen avatar Oct 27 '21 04:10 pietvanzoen

I just totally missed your idea Yes, I should do that — totally agree with you about the renaming. Although, it would be a breaking change… — is it still ok to proceed? I've re–factored the code among config() and configAsync() in the recent PR, to avoid duplication of code, so perhaps I should wait until (and if) that branch is merged…

pasha-bolokhov avatar Jan 12 '22 03:01 pasha-bolokhov

Just for reference this is how to official dotenv from deno std works

https://github.com/pietvanzoen/deno-dotenv#-dotenv-is-now-a-part-of-deno_std-

CanRau avatar Jun 23 '22 04:06 CanRau