How to understand a Deno codebase
Deno runs TypeScript directly, imports modules by URL or by `jsr:` and `npm:` specifiers, and requires explicit permissions for network, file and environment access. Configuration and dependency aliases live in `deno.json`, which plays the role of `package.json` and `tsconfig.json` together.
How to tell it's Deno
deno.jsonordeno.jsonc, often with adeno.lock- Imports like
jsr:@std/httpornpm:express, or aliases from an import map Deno.serve,Deno.env.getandDeno.readTextFilecalls
Where things usually live
- deno.json
- Tasks (scripts), import map, compiler options, lint and format settings.
- main.ts
- Common entry point; check
tasksfor the real one. - routes/ and islands/
- In Fresh apps: file-based routes and interactive components.
- *_test.ts
- Tests run with
deno test.
Conventions, not rules. Real projects rename and move things, so confirm against the repository.
Where to start reading
deno.jsontasks, to find the start command and its permission flags- The import map, to see what bare names point to
- The file passed to
deno run
How a request moves through the code
- A task runs
deno runwith permission flags such as--allow-net. - Deno resolves imports through the import map and caches remote modules.
- The entry calls
Deno.serve(handler), or a framework does. - The handler receives a web-standard
Requestand returns aResponse.
Questions to ask about the repository
- Which permissions does this app need, and why?
- What does each alias in the import map resolve to?
- Is this a Fresh app, a plain
Deno.serveserver or a CLI?
What trips people up
- Missing permission flags cause runtime errors that look like bugs in the code.
- Node-style
process.envandrequiremay not work; look forDeno.envor Node compatibility imports.