octo3.O
Denoβ€’3y agoβ€’
10 replies
octo3.

How to get `require.main.filename` like Node as Deno

I am making a module to be published on deno.land/x.
I want the user to put a file describing the configuration for the module on the same level as the entrypoint file.
I could not figure out how to get the entrypoint filename from the module side.
In Node.js, require.main.filename seems to solve this.
How would this be appropriate to write in Deno?
Was this page helpful?