JavaScript Runtimes Comparing Browser, Node.js, Deno, and Bun - architecture, APIs, performance, and use cases
A comparison of the four major JavaScript runtime environments: Browser, Node.js, Deno, and Bun.
Feature Browser Node.js Deno Bun Initial Release 1995 (Netscape) 2009 2018 2022 Creator Various vendors Ryan Dahl Ryan Dahl Jarred Sumner JS Engine V8 / SpiderMonkey / JSC V8 V8 JavaScriptCore (JSC) Language C++ C++ Rust Zig + C++ Primary Use Client-side web apps Server-side / tooling Server-side / tooling Server-side / tooling Package Manager N/A npm deno add (JSR) / npm bun (npm-compatible) TypeScript Support Via bundler/transpiler Via tsx / ts-node Native (built-in) Native (built-in) Top-Level Await ✅ (ES modules) ✅ (ES modules) ✅ ✅ Permission Model Sandboxed Unrestricted Secure by default Unrestricted
Sandboxed environment : Runs in an isolated context with strict security policies
Event loop : Single-threaded with Web APIs for async operations (setTimeout, fetch, DOM events)
Multi-engine landscape : V8 (Chrome/Edge), SpiderMonkey (Firefox), JavaScriptCore (Safari)
Web APIs : DOM, Fetch, Web Workers, Service Workers, WebSocket, IndexedDB, Canvas, WebGL, WebGPU
// Browser-specific APIs
const response = await fetch ( '/api/data' );
const data = await response. json ();
// DOM manipulation
document. querySelector ( '#app' ).textContent = data.message;
// Web Worker for CPU-intensive tasks
const worker = new Worker ( 'worker.js' );
worker. postMessage ({ task: 'compute' , payload: largeData });
worker. onmessage = ( e ) => console. log (e.data.result);
// Service Worker for offline support
navigator.serviceWorker. register ( '/sw.js' );
V8 engine : Same engine as Chrome, with libuv for async I/O
Event loop : Single-threaded with worker_threads for CPU-intensive tasks
CommonJS & ESM : Supports both module systems (CJS historically, ESM increasingly default)
C++ addons : Native bindings via N-API for performance-critical code
import { readFile } from 'node:fs/promises' ;
import { createServer } from 'node:http' ;
// Built-in HTTP server
const server = createServer ( async ( req , res ) => {
const data = await readFile ( './data.json' , 'utf-8' );
res. writeHead ( 200 , { 'Content-Type' : 'application/json' });
res. end (data);
});
server. listen ( 3000 );
// Worker threads for CPU-intensive tasks
import { Worker } from 'node:worker_threads' ;
const worker = new Worker ( './heavy-computation.js' );
V8 engine + Rust core : Runtime built in Rust using Tokio async runtime
Secure by default : Requires explicit permissions for file, network, and environment access
Web-standard APIs : Aligns with browser APIs where possible (Fetch, Web Streams, Web Crypto)
Built-in toolchain : Formatter, linter, test runner, bundler, documentation generator, LSP
// TypeScript works out of the box - no config needed
import { serve } from "https://deno.land/std/http/server.ts" ;
// Uses Web standard Fetch API
const response = await fetch ( "https://api.example.com/data" );
const data = await response. json ();
// File system with explicit permissions
// Run with: deno run --allow-read --allow-net server.ts
const file = await Deno. readTextFile ( "./data.json" );
// Built-in HTTP server (Web standard API)
Deno. serve ({ port: 3000 }, async ( req ) => {
return new Response ( JSON . stringify ({ hello: "world" }), {
headers: { "Content-Type" : "application/json" },
});
});
JavaScriptCore engine : Uses WebKit's engine (from Safari), optimized for startup and execution speed
Written in Zig : Low-level language with manual memory management for maximum performance
All-in-one toolkit : Runtime, bundler, test runner, package manager in a single binary
Node.js compatible : Designed as a drop-in replacement for Node.js
// TypeScript works natively
import { serve } from "bun" ;
// Bun's optimized HTTP server
serve ({
port: 3000 ,
fetch ( req ) {
return new Response ( JSON . stringify ({ hello: "world" }), {
headers: { "Content-Type" : "application/json" },
});
},
});
// Fast file I/O with Bun APIs
const file = Bun. file ( "./data.json" );
const data = await file. json ();
// Built-in SQLite
import { Database } from "bun:sqlite" ;
const db = new Database ( "mydb.sqlite" );
API Browser Node.js Deno Bun Fetch ✅ Native ✅ (v18+) ✅ Native ✅ Native Web Streams ✅ Native ✅ (v18+) ✅ Native ✅ Native Web Crypto ✅ Native ✅ (v19+) ✅ Native ✅ Native WebSocket ✅ Native ❌ (third-party) ✅ Native ✅ Native URL / URLSearchParams ✅ Native ✅ ✅ Native ✅ Native TextEncoder / TextDecoder ✅ Native ✅ ✅ Native ✅ Native AbortController ✅ Native ✅ (v15+) ✅ Native ✅ Native FormData ✅ Native ✅ (v18+) ✅ Native ✅ Native structuredClone ✅ Native ✅ (v17+) ✅ Native ✅ Native Web Workers ✅ Native ⚠️ worker_threads ✅ Web Workers ✅ Web Workers DOM APIs ✅ Native ❌ ❌ ❌
API Browser Node.js Deno Bun File System ❌ (File API only) ✅ node:fs ✅ Deno.readFile / node:fs ✅ Bun.file / node:fs Child Process ❌ ✅ node:child_process ✅ Deno.Command / node:child_process ✅ Bun.spawn / node:child_process TCP / UDP Sockets ❌ ✅ node:net ✅ Deno.connect ✅ Bun.listen HTTP Server ❌ ✅ node:http ✅ Deno.serve ✅ Bun.serve SQLite ❌ ❌ (third-party) ❌ (third-party) ✅ bun:sqlite FFI (Foreign Function Interface) ❌ ❌ (N-API / node-gyp) ✅ Deno.dlopen ✅ bun:ffi Test Runner ❌ ✅ node:test (v18+) ✅ Deno.test ✅ bun:test
Module Node.js Deno Bun node:fs ✅ ✅ ✅ node:path ✅ ✅ ✅ node:http ✅ ✅ ✅ node:crypto ✅ ✅ ✅ node:stream ✅ ✅ ✅ node:buffer ✅ ✅ ✅ node:events ✅ ✅ ✅ node:child_process ✅ ✅ ✅ node:worker_threads ✅ ✅ ✅ node:net ✅ ✅ ✅ node:dgram ✅ ⚠️ Partial ⚠️ Partial node:cluster ✅ ❌ ❌
Aspect Browser Node.js Deno Bun ES Modules ✅ (native) ✅ (.mjs / "type": "module") ✅ (default, only) ✅ (default) CommonJS ❌ ✅ (default historically) ⚠️ Compatibility layer ✅ URL Imports ✅ (script tags) ❌ ✅ ❌ Import Maps ✅ ⚠️ Experimental ✅ ❌ JSR Registry N/A ✅ (via npx jsr) ✅ (native) ✅ (via bunx jsr) npm Registry N/A ✅ (native) ✅ (npm: specifier) ✅ (native) package.json N/A ✅ (required) ✅ (optional) ✅ (required)
Runtime Hello World JSON Serialization Notes Bun ~110,000 ~95,000 Fastest HTTP server Deno ~80,000 ~70,000 V8 + Rust hyper Node.js ~55,000 ~48,000 V8 + libuv
Runtime Empty Script Import Heavy Module Notes Bun ~5ms ~20ms JSC + Zig = fastest cold start Deno ~20ms ~60ms V8 + snapshot Node.js ~30ms ~80ms V8 + module resolution
Package Manager Install 100 deps (cold) Install 100 deps (cached) bun install ~2s ~0.3s pnpm install ~8s ~1.5s npm install ~15s ~3s yarn install ~12s ~2s
Runtime Method Overhead Bun Native transpilation (JSC) Near zero Deno Native transpilation (SWC) Near zero Node.js (tsx) On-the-fly via esbuild Low (~50ms startup) Node.js (ts-node) On-the-fly via TypeScript compiler High (~500ms startup) Node.js (--experimental-strip-types) Built-in type stripping (v22.6+) Low
Tool Browser Node.js Deno Bun Package Manager N/A npm deno add bun Bundler N/A ❌ (third-party) deno bundle (deprecated) → JSR bun build Test Runner N/A node --test (v18+) deno test bun test Formatter N/A ❌ (Prettier) deno fmt ❌ (Prettier) Linter N/A ❌ (ESLint) deno lint ❌ (ESLint) Type Checker N/A ❌ (tsc) deno check ❌ (tsc) REPL ✅ (DevTools) node deno bun Benchmarking ❌ ❌ (third-party) deno bench ❌ (third-party) Task Runner N/A npm scripts deno task bun run LSP N/A ❌ (third-party) deno lsp ❌ (third-party) Documentation N/A ❌ (third-party) deno doc ❌ (third-party) Compile to Binary N/A node --experimental-sea deno compile bun build --compile
Aspect Browser Node.js Deno Bun Default Permissions Sandboxed (minimal) Full access No access (secure) Full access File System ❌ Blocked ✅ Full --allow-read / --allow-write ✅ Full Network Same-origin policy ✅ Full --allow-net ✅ Full Environment Variables ❌ N/A ✅ Full --allow-env ✅ Full Subprocess ❌ N/A ✅ Full --allow-run ✅ Full FFI ❌ N/A N/A --allow-ffi ✅ Full Granular Scoping Origin-based ❌ ✅ (per-domain, per-path) ❌
# Deno: explicit permissions
deno run --allow-read=./data --allow-net=api.example.com server.ts
# Deno: allow all (not recommended for production)
deno run -A server.ts
# Node.js: experimental permission model (v20+)
node --experimental-permission --allow-fs-read=./data server.js
Framework Node.js Deno Bun Express ✅ ✅ ✅ Fastify ✅ ⚠️ Partial ✅ Koa ✅ ✅ ✅ Hono ✅ ✅ ✅ Elysia ⚠️ Limited ❌ ✅ (optimized for Bun) Fresh ❌ ✅ (Deno-native) ❌ Oak ⚠️ Limited ✅ (Deno-native) ❌
Framework Node.js Deno Bun Next.js ✅ ⚠️ Partial ⚠️ Partial Nuxt ✅ ✅ ⚠️ Partial SvelteKit ✅ ✅ ⚠️ Partial Astro ✅ ✅ ⚠️ Partial Remix ✅ ✅ ⚠️ Partial
Library Node.js Deno Bun Prisma ✅ ✅ ✅ Drizzle ✅ ✅ ✅ TypeORM ✅ ⚠️ Partial ⚠️ Partial Mongoose ✅ ✅ ✅
Platform Node.js Deno Bun Browser (WASM) AWS Lambda ✅ ✅ (custom runtime) ✅ (custom runtime) N/A Vercel Functions ✅ ✅ ⚠️ Experimental N/A Cloudflare Workers ⚠️ (workerd, not full Node.js) ❌ ❌ ✅ (V8 isolates) Deno Deploy ❌ ✅ (native) ❌ N/A Netlify Functions ✅ ✅ ❌ N/A Fly.io ✅ ✅ ✅ N/A
Aspect Node.js Deno Bun Docker Image Size ~150 MB (alpine) ~130 MB ~100 MB Compile to Single Binary ⚠️ Experimental (SEA) ✅ deno compile ✅ bun build --compile Distroless Image ✅ ✅ ✅
Aspect Node.js Deno Bun GitHub Stars ~110K ~100K ~75K npm Packages 2,000,000+ Compatible via npm: specifier Compatible (native npm) JSR Packages Supported Native registry Supported Corporate Backing OpenJS Foundation Deno Land Inc. Oven Job Market Largest Growing Emerging Production Adoption Ubiquitous Growing (Slack, Netlify) Early adopters Documentation Comprehensive Excellent Good
Building client-side web applications (the only option for end-user web)
Leveraging DOM APIs and browser-specific features (Canvas, WebGL, WebGPU)
Need sandboxed execution with strict security boundaries
Building PWAs with Service Workers and offline support
Building production backend services with maximum ecosystem compatibility
Need the largest package ecosystem and widest library support
Working with enterprise infrastructure that expects Node.js
Team has existing Node.js expertise and codebase
Require mature tooling and battle-tested stability
Security is a priority and want permissions by default
Prefer Web standard APIs and modern JavaScript conventions
Want an all-in-one toolchain (fmt, lint, test, bench, doc, lsp)
Building for Deno Deploy edge platform
Starting new projects without legacy CommonJS dependencies
Working with TypeScript-first workflows without configuration
Performance is critical (HTTP throughput, startup time)
Want the fastest package manager and install times
Need native TypeScript execution with minimal overhead
Building performance-sensitive APIs and microservices
Using Elysia or other Bun-optimized frameworks
Want built-in SQLite for embedded database use cases
Best For Runtime Client-Side Web Browser Ecosystem & Stability Node.js Security & Standards Deno Raw Performance Bun TypeScript DX Deno / Bun Built-in Tooling Deno Package Install Speed Bun Enterprise / Production Node.js Edge Deployment Deno (Deno Deploy) / Browser (CF Workers) Drop-in Node.js Replacement Bun
All three server-side runtimes are converging on Web standard APIs (Fetch, Web Streams, Web Crypto) and improving Node.js compatibility. Node.js remains the safe choice for production with the largest ecosystem. Deno leads in security, tooling, and standards compliance. Bun pushes the performance envelope and offers the best developer experience for speed-sensitive workflows. The Browser remains the only runtime for client-side web applications and continues to gain powerful APIs (WebGPU, WebTransport, WebAssembly).