This repository was archived by the owner on Sep 2, 2023. It is now read-only.
This repository was archived by the owner on Sep 2, 2023. It is now read-only.
Spec: Would !!import.meta ? 'module' : 'not'
be a reasonable ask? #395
Open
Description
I'm think we all must have considered this at some point, but cannot recall.
Q: Is there a safe way for code to test if it is module
or not (ie not early/parse error)?
This code would target runtimes supporting import(…)
globally, irrespective of semantics, and so my thinking was a clean nice-to-have here could be !!import.meta ? 'module' : 'not'
which should not be too much to ask for… thoughts?
Possibly Related Discussions
import.meta.main
in import.meta.main node#49440