<p dir="auto">This may sound weird but a deno.info api would be really helpful for me. (Exposing the output of the deno info command in some form without having to access the CLI.)</p>
<p dir="auto">My use case is having deno make requests for the module and all imported modules to the webserver it's also running (allowing the server to trigger compiles for said modules.) and caching external modules to the local webserver by making requests. Finally, checking if any of the modules are loading from internet sources as opposed to local cache sources.</p>
<p dir="auto">I'm sure there could be other ways of doing this, but it might be nice to be able to build custom tooling around the deno info command.</p>
<p dir="auto">Currently "deno info <a href="https://deno.land/std/http/file_server.ts" rel="nofollow">https://deno.land/std/http/file_server.ts</a>" will display a dependency graph of the specified module. It would be nice to be able to access this information in a programmatic way.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="let depTree = await Deno.deps(&quot;https://deno.land/std/http/file_server.ts&quot;)"><pre class="notranslate"><code class="notranslate">let depTree = await Deno.deps("https://deno.land/std/http/file_server.ts")
</code></pre></div>
<p dir="auto">Where depTree would be some JSON encodable object similar to the current output.</p>
<p dir="auto">The first step to exposing this would be pure rust functionality of turning a <code class="notranslate">Deps</code> structure into a JSON string: </p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/denoland/deno/blob/960ee5257a7b38c6b3b59a3dca670c7c1771996f/cli/modules.rs#L188">deno/cli/modules.rs</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 188
      in
      <a data-pjax="true" class="commit-tease-sha" href="/denoland/deno/commit/960ee5257a7b38c6b3b59a3dca670c7c1771996f">960ee52</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L188" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="188"></td>
          <td id="LC188" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">Deps</span> <span class="pl-kos">{</span> </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>