
deno_graph
https://github.com/denoland/deno_graph- Category
- Developer Tools
- Rank
- No. 850Tools index
- Pricing
- Open Source
- Type
- TOOL
- Builder
- denoland
- GitHub
- 137 stars
- Latest release
- 0.111.0
- Date
About
Module graph engine that powers the Deno CLI — analyze and resolve TypeScript/JavaScript imports.
What it does
Starting from one or more module URLs, deno_graph asks caller-supplied loading code for source, parses each module, follows dependencies recursively, and returns a structured graph. Callers can replace resolution rules and attach cache metadata.
Why it's ranked here
This is strong infrastructure for applications that need Deno-compatible dependency semantics without embedding the entire CLI. The Rust core, JavaScript-facing WebAssembly layer, configurable loading, and replaceable resolution make it unusually reusable. The explicit non-semantic versioning policy raises integration risk.
What's good
Loading is cleanly separated from graph construction, so callers can handle redirects, failures, cached data, and local or remote content. Custom resolution supports import maps, alternative rules, and separate type targets. Source ranges preserve where type dependencies originated, improving downstream errors. An in-memory loader supports tests and preloaded sources.
Tradeoffs
The crate deliberately does not follow semantic versioning, so consumers must pin an exact patch release. Callers must provide loading behavior, and richer resolution may require custom integration. Building the WebAssembly package requires the Deno CLI. The JavaScript bridge uses no real filesystem and supplies no npm resolver.
How to use it well
Use it when a Rust or JavaScript tool must inspect dependency structure with Deno-style resolution, especially with custom fetching, caching, import maps, or type mapping. It suits analyzers and other graph-aware tooling. It does not acquire ordinary module content by itself, because the host supplies that service.
Technical notes+
Cargo.toml defines the deno_graph Rust library, MIT licensing, optional deno_ast, swc, symbols, and fast_check features, plus native-only Tokio support through deno_unsync. src/lib.rs exposes graph construction, parsing, module models, ranges, loaders, resolvers, and an executor abstraction. src/analysis.rs models static and dynamic dependencies, import attributes, TypeScript references, JSDoc imports, JSX hints, and source-map locations. src/ast/mod.rs provides the default AST-backed analyzer and reusable parsed-source stores. lib/lib.rs implements the wasm-bindgen bridge, adapts JavaScript loading and resolution callbacks, serializes graphs as JavaScript objects, uses NullFileSystem, and leaves npm resolution unset. deno.json defines WebAssembly, npm packaging, and Deno test tasks. Cargo.toml also declares dedicated specs and ecosystem test targets.
Observed
- License
- MIT
- Primary language
- Rust
- Packaging
- Rust crate with WebAssembly output, a JSR package surface, and an npm build task
- Interfaces
- Rust library API and JavaScript/TypeScript WebAssembly interface
- Platform support
- Native targets and wasm32 are handled with target-specific runtime behavior
- Testing structure
- Dedicated specs and ecosystem test targets, inline Rust tests, and a Deno test task
Read from README.md, deno.json, Cargo.toml, src/lib.rs, src/rt.rs, lib/lib.rs, src/jsr.rs, src/graph.rs, src/analysis.rs, src/packages.rs, src/collections.rs, src/module_specifier.rs, src/ast/mod.rs.
What it can do
Analyze module dependency graph
TypeScript/JavaScript module files → Module dependency graph structure
Resolve import statements
TypeScript/JavaScript files with import statements → Resolved module paths and dependencies
Parse TypeScript modules
TypeScript source files → Parsed module metadata and structure
Parse JavaScript modules
JavaScript source files → Parsed module metadata and structure
Detect circular dependencies
Module dependency graph → List of circular dependency chains
Map module relationships
Collection of TypeScript/JavaScript modules → Module relationship mapping
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.