ImportMeta.main - Web documentation
property ImportMeta.main

A flag that indicates if the current module is the main module that was called when starting the program under Deno.

if (import.meta.main) {
  // this was loaded as the main module, maybe do some bootstrapping
}

Type

boolean