main: boolean
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
}
Deno provides extra properties on import.meta
. These are included here to ensure that these are still available when using the Deno namespace in conjunction with other type libs, like dom
.
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
}
A string representation of the fully qualified module URL.
© 2018–2021 the Deno authors
https://doc.deno.land/deno/stable/~/ImportMeta