Deno

On this page 7

Deno is an open-source runtime for JavaScript and TypeScript built on the V8 engine and the Rust programming language, designed to run code outside the browser with secure defaults, web-standard APIs and a built-in toolchain. In web architecture, it serves the same backend role as Node.js: it executes server code, command-line tools and build scripts that power Web applications.

Deno was created by Ryan Dahl, the original author of Node.js, who presented it in 2018 as an answer to design decisions in Node that he considered mistakes. Version 1.0 appeared in 2020, and Deno 2, released in 2024, added broad compatibility with Node.js and npm, which removed the main obstacle to adopting it in existing projects.

How Deno executes code

Deno combines three core components: the V8 JavaScript engine for executing code, Rust for the runtime itself and its system bindings, and the Tokio asynchronous runtime for the event loop and non-blocking input and output. TypeScript files are type-stripped and transpiled internally, so developers can run a .ts file directly without a separate compiler step.

A central design choice is the use of web platform APIs wherever they make sense. Deno exposes fetch, Request, Response, Web Streams, URL, Web Crypto and Web Workers with the same semantics as in browsers, so much code can be shared between frontend and backend. Runtime-specific features live under the global Deno namespace, for example Deno.serve() for HTTP servers and Deno.readTextFile() for file access.

Modules follow the ECMAScript module standard. Dependencies can be imported by URL, from the JSR registry designed for TypeScript packages, or from npm through the npm: specifier, and versions are pinned in a deno.json file and a lock file.

The permission model in Deno

Deno is secure by default: a script has no access to the file system, network, environment variables or subprocesses unless the user grants it explicitly. This contrasts with Node.js, where any installed package can read files or open network connections as soon as it runs, which is a major concern for software supply chain attacks.

Permissions are granted with command-line flags and can be scoped to specific paths or hosts, so a script can be allowed to contact a single API domain and nothing else. The table lists the main flags.

FlagGrants access toExample of scoping
–allow-netNetwork connections and listening--allow-net=api.example.com
–allow-readReading files--allow-read=./data
–allow-writeWriting files--allow-write=./logs
–allow-envEnvironment variables--allow-env=DATABASE_URL
–allow-runStarting subprocesses--allow-run=git
–allow-ffiNative libraries through FFIPath to a specific library
-AAll permissionsNo scoping, equivalent to Node.js behavior
Main permission flags in Deno

The model is a process-level boundary, not a sandbox per dependency: once network access is granted, every module in the process shares it. Teams that run with -A out of convenience lose most of the security benefit.

Deno compared with Node.js and Bun

Deno, Node.js and Bun are the three main server-side JavaScript runtimes, and since Deno 2 they overlap heavily in what code they can run. They differ in security posture, tooling philosophy and maturity of their ecosystems.

PropertyDenoNode.jsBun
EngineV8V8JavaScriptCore
Implementation languageRustC++Zig
Default securityPermissions requiredFull accessFull access
TypeScriptRuns nativelyType stripping in recent versionsRuns natively
Built-in toolingFormatter, linter, tests, compilerTest runner, limited toolingBundler, tests, package manager
Package sourcesJSR, npm, URLsnpmnpm
Ecosystem maturityGrowingLargest and oldestYoungest
Server-side JavaScript runtimes compared

Node.js remains the default choice for most production backends because of its long track record and hosting support. Deno appeals to teams that value strict security, TypeScript without configuration and a single binary that replaces several separate tools.

Built-in toolchain and deployment

Deno ships as a single executable that bundles the tools a JavaScript project normally assembles from many packages. This reduces configuration files, version conflicts between tools and onboarding time for new developers.

CommandPurposeReplaces in a typical Node.js setup
deno fmtCode formattingPrettier
deno lintStatic analysisESLint
deno testUnit testing with coverageJest or Vitest
deno checkType checkingtsc
deno compileStandalone executablepkg or similar bundlers
deno taskProject scriptsnpm scripts
Selected Deno subcommands

For deployment, Deno code runs in containers like any other server process, and the company behind it operates Deno Deploy, a platform that runs code on globally distributed servers close to users. The Fresh web framework, built for Deno, uses an islands approach that sends JavaScript only for interactive components, which fits edge rendering architectures well.

Limitations and adoption considerations

Despite Deno 2 compatibility, not every npm package works unchanged. Packages that rely on native add-ons, undocumented Node.js internals or unusual module resolution may need workarounds. Before migrating, teams should test the full dependency tree rather than assume compatibility.

  • Smaller talent pool: fewer developers have production experience with Deno than with Node.js.
  • Hosting support is broad for containers but thinner for managed platforms that assume Node.js.
  • Permission friction can frustrate developers until flags are captured in deno.json tasks.
  • Early ecosystem churn: the shift from URL imports toward JSR and npm changed recommended practices within a few years.

Deno fits best for new TypeScript services, internal tools, scripts that handle untrusted input and edge functions. For large existing Node.js codebases, the migration cost often outweighs the benefits unless security or tooling consolidation is a priority.

The short version

JavaScript was born inside web browsers. To run it on servers, programmers need a separate program called a runtime. Deno is one such runtime, made by the same person who created Node.js, with lessons from the first attempt built in.

Its biggest difference is caution. A Deno program is like a guest who must ask permission before opening any door: reading files, using the internet or starting other programs. It also comes with its own formatting, testing and checking tools, so developers need fewer extra pieces to get started.

Where it makes a difference

A small fintech team needs a service that converts uploaded CSV statements into a normalized format and sends the results to an internal ledger API. Because the uploaded files come from customers, the team treats the parsing code and its dependencies as a potential risk and chooses Deno for the job.

The service runs with --allow-read=/uploads, --allow-net=ledger.internal and no other permissions. When a compromised CSV parsing package from npm later attempts to send environment variables to an external server, the runtime blocks the network request and logs a permission error instead of leaking secrets.

The team also replaces separate formatter, linter and test packages with built-in Deno commands, cutting its configuration files from seven to one deno.json. The incident confirms the value of least-privilege permissions for code that touches untrusted data.