How can I detect if an ECMAScript module is the main module? This is easy for CommonJS modules (see Detect if called through require or directly by command line).
- There is no - requireor- require.main
- No - process.mainModule
- The - import.metahas no clues, only has- url
 
     
    