<p dir="auto">Is there currently a way to run a locally built npm executable script using <code class="notranslate">deno run</code>. I'm thinking of something like this:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="deno run --allow-env --allow-read npm:&lt;local-path&gt;"><pre class="notranslate">deno run --allow-env --allow-read npm:<span class="pl-k">&lt;</span>local-path<span class="pl-k">&gt;</span></pre></div>
<p dir="auto">The scenario is running node code that we don't to publish to a public repository.</p>
<p dir="auto">I discovered the <code class="notranslate">createRequire</code> method, e.g.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { createRequire } from &quot;node:module&quot;;
const require = createRequire(import.meta.url);
require(&quot;./script.js&quot;);"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">createRequire</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"node:module"</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">require</span> <span class="pl-c1">=</span> <span class="pl-en">createRequire</span><span class="pl-kos">(</span><span class="pl-k">import</span><span class="pl-kos">.</span><span class="pl-c1">meta</span><span class="pl-kos">.</span><span class="pl-c1">url</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">require</span><span class="pl-kos">(</span><span class="pl-s">"./script.js"</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">However, the script has some behavior that isn't handled well including a dynamic <code class="notranslate">import()</code> of an <code class="notranslate">mjs</code> module as well as Mathjax which might also do some non-standard importing?  I'm guessing that <code class="notranslate">deno run</code> for <code class="notranslate">npm</code> scripts might setup some additional facilities to make more scenarios work properly than <code class="notranslate">createRequire</code> does?</p>
<p dir="auto">Anyway, if there is a way to do this for local npm executable scripts it would be fabulous!</p>
<p dir="auto">Is there any way to use a local (modified) copy of an NPM package instead of a published one in this command? Thanks!</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="deno run -A --unstable npm:vite"><pre class="notranslate">deno run -A --unstable npm:vite</pre></div>