1

Short: Basically, what I want is this in deno.

Long: I want to save files in deno. I am using Deno.writeTextFile for that. This works allright but my problem is that the location my file is saved at depends on the location from which I write deno run in my command line.

I don't want the location of the file to be dependent on whether I run it from one folder or another.

I also don't want the location of the file to be dependent on the structure of my files of my PC therefore I can't use "C:/..../test.json" as the save-location.

What I would like to do is find out the location of the script-file in which the file is created and then calculate the location of my new file based on the location of the file. Is something like this possible in deno?

In node there is the variable __filename for this scenario but how can I do that in deno?

IceRevenge
  • 1,451
  • 18
  • 33

0 Answers0