0.69.6
The module graph logic for Deno CLI
Attributes
Very Popular
Official Deno project
Repository
Current version released
8 months ago
Dependencies
deno.land/x
Versions
- 0.69.6Latest
- 0.69.5
- 0.69.4
- 0.69.3
- 0.69.2
- 0.69.1
- 0.69.0
- 0.68.1
- 0.68.0
- 0.67.0
- 0.66.2
- 0.66.1
- 0.66.0
- 0.65.3
- 0.65.1
- 0.65.0
- 0.64.2
- 0.64.1
- 0.63.6
- 0.63.5
- 0.63.4
- 0.63.3
- 0.63.2
- 0.63.1
- 0.63.0
- 0.62.3
- 0.62.2
- 0.62.1
- 0.62.0
- 0.61.5
- 0.61.4
- 0.61.3
- 0.61.2
- 0.61.1
- 0.61.0
- 0.60.0
- 0.59.2
- 0.59.1
- 0.59.0
- 0.58.0
- 0.57.1
- 0.57.0
- 0.56.3
- 0.56.2
- 0.56.1
- 0.56.0
- 0.55.0
- 0.54.0
- 0.53.0
- 0.52.1
- 0.52.0
- 0.51.0
- 0.50.0
- 0.49.0
- 0.48.1
- 0.48.0
- 0.47.1
- 0.47.0
- 0.46.0
- 0.45.1
- 0.45.0
- 0.44.3
- 0.44.2
- 0.44.1
- 0.44.0
- 0.43.3
- 0.43.2
- 0.43.1
- 0.42.0
- 0.41.0
- 0.40.0
- 0.39.0
- 0.38.0
- 0.37.1
- 0.37.0
- 0.36.0
- 0.34.0
- 0.33.0
- 0.32.0
- 0.31.0
- 0.30.0
- 0.29.0
- 0.28.0
- 0.27.0
- 0.26.0
- 0.25.0
- 0.24.0
- 0.23.0
- 0.22.0
- 0.21.1
- 0.21.0
- 0.20.0
- 0.19.1
- 0.19.0
- 0.18.0
- 0.17.0
- 0.16.0
- 0.15.0
- 0.14.2
- 0.14.1
- 0.14.0
- 0.13.0
- 0.12.0
- 0.11.1
- 0.11.0
- 0.10.0
- 0.9.1
- 0.9.0
- 0.8.2
- 0.8.1
- 0.8.0
- 0.7.0
- 0.6.0
- 0.5.0
- 0.4.0
- 0.2.1
- 0.3.1
- 0.3.0
- 0.2.2
- 0.2.0
- 0.1.0
deno_graph
This repository includes a compiled version of the Rust crate as Web Assembly
and exposes an interface which is available via the mod.ts
in this repository
and can be imported like:
import * as denoGraph from "https://deno.land/x/deno_graph@{VERSION}/mod.ts";
Where {VERSION}
should be substituted with the specific version you want to
use.
createGraph()
The createGraph()
function allows a module graph to be built asynchronously
and returns a single JavaScript object containing the module graph information.
It requires a root specifier or any array of root specifiers to be passed, which
will serve as the roots of the module graph.
There are several options that can be passed the function in the optional
options
argument:
load
- a callback function that takes a URL string and a flag indicating if the dependency was required dynamically (e.g.const m = await import("mod.ts")
) and resolves with aLoadResponse
. By default aload()
function that will attempt to load local modules viaDeno.readFile()
and load remote modules viafetch()
.cacheInfo
- a callback function that takes a URL string and returns aCacheInfo
object. In the Deno CLI, theDENO_DIR
cache info is passed back using this interface. If the function is not provided, the information is not present in the module graph.resolve
- a callback function that takes a string and a referring URL string and returns a fully qualified URL string. In the Deno CLI, import maps provide this callback functionality of potentially resolving modules differently than the default resolution.resolveTypes
- a callback function that takes a URL string and returns the types dependency for the specifier, along with optionally the source of the types dependency. This only gets called in situations where the module is potentially untyped (e.g. JavaScript, JSX) and no other type dependency was detected. This is intended to enrich the module graph with external types that are resolved in some other fashion, like from apackage.json
or via detecting an@types
typings package is available.