<p dir="auto">Looking for a way to get a parsed <code class="notranslate">deno info</code> object in user.land. Is there a way to avoid implementing it?</p>
<p dir="auto">JavaScript in the browser does not check imports for environmental (ex: dom use in workers) errors. Deno, however, by default does. This creates problems for browser based code running in deno. We need a flag to skip this checking so that deno behaves like the browser.</p>
<p dir="auto">Example: I have a large utilities file which includes both vanilla JS exports and dom exports. Many of the"apps" using this run in both workers and in the main thread even tho the utilities library uses the dom. This is possible because imports are not error-checked at load time, but naturally fail at run-time if a worker asks for a dom utility.</p>
<p dir="auto">Load-time checking would require duplicating the apps, one for workers, another for main thread browser apps.</p>
<p dir="auto">I believe run-time failure is the standard, thus making this worker/main-thread sharing possible.</p>
<p dir="auto">So when I run an app in deno that uses no dom utility, I still get:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: Uncaught ReferenceError: document is not defined
       const can = document.createElement('canvas')"><pre class="notranslate"><code class="notranslate">error: Uncaught ReferenceError: document is not defined
       const can = document.createElement('canvas')
</code></pre></div>
<p dir="auto">.. i.e. is  a load-time error rather than a run-time error.</p>
<p dir="auto">I believe this may be common for devs wishing to run their modern JS apps in places other than the browser such as node, deno, bun and others.</p>
<p dir="auto">Thus the need for an option for run-time errors rather than load-time pre-checking.</p>