DenoDDeno
Powered by
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
require.main.filename
seems to solve this.
How would this be appropriate to write in Deno?
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,944Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to use Deno like Node.js.
hephzisoftHhephzisoft / help
16mo ago
How to note require the node: prefix
togakangarooTtogakangaroo / help
16mo ago
deno_node
alexAalex / help
17mo ago
migrate node to deno
Th3Us3rNam3TTh3Us3rNam3 / help
11mo ago