Skip to main content

JavaScript

Runtimes

Runtimes are environments where JavaScript code executes, in or out of browsers.

Node.jsDenoBunBrowser
EngineV8V8 + RustJavaScriptCore (JSC)V8 / JSC / SpiderMonkey
LanguageC++RustZigC++ / C
TypeScript Support❌ (via transpiler)✅ (native)✅ (native)❌ (via bundler)
Built-in Tools✅ formatter, test, lint✅ bundler, transpiler, test
Permissions Security✅ secure by default✅ sandboxed
PerformanceMediumMediumFastMedium

CommonJS vs. ES Modules (ESM)

CommonJSES Modules
Importconst fs = require("fs");import fs from "fs";
Exportmodule.exports = { fs };export { fs };

All modern browsers, and Node.js 12+ now support ES Modules. CommonJS and extension .cjs should be avoided in favor of ES Modules and extension .mjs whenever possible.