Reputation: 189
As the title says. For example, I can check for the following in node:
if(process.main===module) console.log('This is being called as a module');
Is there any way, as of current, that I can check for the same thing in deno?
Upvotes: 0
Views: 85
Reputation: 1581
You can use import.meta.main
, which will be false
if it is called from a module.
Upvotes: 1