On this page
Get started with Deno
Deno
(/ˈdiːnoʊ/, pronounced
dee-no) is an
open source JavaScript,
TypeScript, and WebAssembly runtime with secure defaults and a great developer
experience. This page takes you from nothing to a running, tested project in a
few minutes.
Why Deno? Jump to heading
- Works with your existing Node.js projects.
Drop Deno into a repo with
package.jsonandnode_modulesand it just runs; mixnpm:imports with native ES modules as you migrate. - Modern module system. ES modules with URL imports, JSR for typed packages, and workspaces.
- TypeScript-first. Run
.tsfiles directly. Notsc, no build step, no config. - Secure by default. Code runs in a sandbox with no file, network, or environment access until you grant it.
- A full toolchain, no plumbing. Built-in
formatter, linter,
test runner, benchmarking, and
a lot more. No
devDependenciesto wire up.
Install Deno Jump to heading
Install the runtime with one command:
curl -fsSL https://deno.land/install.sh | sh
irm https://deno.land/install.ps1 | iex
Verify the install:
deno --version
See Installation for package managers, Docker, and other options.
Create a project Jump to heading
Scaffold a new project with deno init:
deno init my_project
That creates a small, ready-to-run project:
my_project
├── deno.json # project configuration: tasks, imports, lint/fmt settings
├── main.ts # a tiny HTTP server built on Deno.serve
└── main_test.ts # its tests
deno.json is where your tasks, dependencies,
and tooling config live. Think package.json plus your tool configs, in one
file.
Run it Jump to heading
$ cd my_project
$ deno -N main.ts
Listening on http://localhost:8000/
Notice the -N (short for --allow-net). Deno is
secure by default: code can't touch the
network, filesystem, or environment until you grant it. Open the URL to see the
response.
main.ts is TypeScript and it ran directly: no tsc, no build step. It's
also built on the web-standard Deno.serve with
Request/Response, so what you learn here is the platform, not a framework.
Test it Jump to heading
The project ships with tests. Run them with deno test. The
test runner is built in, so there's nothing to install:
$ deno test
running 2 tests from ./main_test.ts
returns html on / ... ok (12ms)
returns json on /api ... ok (0ms)
ok | 2 passed | 0 failed (15ms)
Add a dependency Jump to heading
Pull in packages from npm or JSR with
deno install:
deno install express # any npm package, like npm install
deno install jsr:@std/assert # the Deno standard library, on JSR
Then import and use them:
import { assertEquals } from "@std/assert";
assertEquals(1 + 1, 2);
Use the built-in toolchain Jump to heading
Formatting, linting, and more come with the runtime, no setup needed:
deno fmt # format your code
deno lint # catch problems
deno task # run scripts defined in deno.json
Next steps Jump to heading
- Set up your editor. Autocomplete, inline errors, and formatting on save.
- Run code. Servers, tasks, web APIs, and debugging.
- Manage packages. Dependencies, workspaces, publishing.
- Migrate from Node.js. Bring an existing project across.
- Examples and tutorials. Ideas for what to build next.