Deno
Deno is a JavaScript runtime toolchain that runs JavaScript and TypeScript files in a sandbox and ships a formatter, a linter, a test runner, and a task runner in one deno executable. Code has no file, network, or environment access until a command-line flag grants it.
Deno comes from Ryan Dahl, who also created Node.js. It’s a separate implementation, built in Rust on the V8 engine. Since Deno 2, released in October 2024, it also runs projects that have a package.json file and a node_modules folder. Another runtime toolchain for the same job is Bun.
Installation and Setup
Deno is installed once per machine. On macOS and Linux, Deno’s documentation recommends the official install script:
$ curl -fsSL https://deno.land/install.sh | sh
On Windows, run this in PowerShell:
PS> irm https://deno.land/install.ps1 | iex
Next, confirm the installed version:
$ deno --version
deno 2.9.8 (stable, release, x86_64-unknown-linux-gnu)
v8 15.0.245.2-rusty
typescript 6.0.3
Key Features
- Runs
.tsfiles directly, without a separate build step. - Blocks file, network, and environment access unless flags such as
--allow-reador--allow-netgrant it. - Imports npm packages through
npm:specifiers and runs existing projects that usepackage.json. - Formats, lints, and tests code with the built-in
deno fmt,deno lint, anddeno testcommands. - Runs named scripts from the
tasksfield indeno.jsonwithdeno task.
Usage
Say a shop’s cart.ts script reads its items from a prices.json file and logs the order total. The --allow-read flag grants read access, so the script runs:
$ deno run --allow-read cart.ts
Total: 22.5
Without the flag, Deno asks for permission in an interactive terminal. When access is refused, the read throws a NotCapable error.
The init command creates a new project with a deno.json config file, a main.ts module, and a main_test.ts test file:
$ deno init shop
Inside the project folder, the test command type-checks and runs every test file:
$ deno test
Check main_test.ts
running 2 tests from ./main_test.ts
returns html on / ... ok (9ms)
returns json on /api ... ok (644µs)
ok | 2 passed | 0 failed (18ms)
The tasks field in deno.json gives longer commands a short name:
{
"tasks": {
"dev": "deno run --watch --allow-net main.ts"
}
}
With that task defined, deno task dev starts the server and restarts it when a file changes:
$ deno task dev
The fmt and lint commands format and check every file in the project:
$ deno fmt
$ deno lint
For every command and flag, see the Deno documentation.
Related Resources
Tutorial
Java vs JavaScript: The Real Difference and Where to Start
Java vs JavaScript: they share a name thanks to a 1995 marketing deal, not a shared design. Here's the story, the real difference, and which to learn first.
Have a question about this? Mentor AI can show you examples, compare related terms, and point you to tutorials.
By Leodanis Pozo Ramos • Updated Nov. 6, 2026