Deno in 2 Minutes: Install, Hello World, and Core Features

This article introduces Deno 1.0.0, outlines its security‑focused design and TypeScript support, provides step‑by‑step installation commands for macOS, Linux, and Windows, demonstrates a simple Hello World server, and explains required permissions and how it compares to Node.js.

JavaScript
JavaScript
JavaScript
Deno in 2 Minutes: Install, Hello World, and Core Features

Deno Overview

Deno v1.0.0 has been released. It is a V8‑based JavaScript and TypeScript runtime created by Ryan Dahl, the original creator of Node.js, who wanted to address design mistakes he perceived in Node.

Key Features

Secure by default: Deno cannot access the network or file system unless explicitly permitted.

Built‑in Promise support.

No npm; modules are imported via URLs or file paths, similar to browsers.

Native TypeScript support.

Installation

For macOS users, install via Homebrew: brew install deno For generic shell users, use the curl script:

curl -fsSL https://deno.land/x/install/install.sh | SH

Windows users can install with PowerShell:

iwr https://deno.land/x/install/install.ps1 -useb | iex

Additional installation methods are documented at https://github.com/denoland/deno_install .

Hello World Example

Save the following code as example.ts and run it with Deno:

import { serve } from "https://deno.land/[email protected]/http/server.ts";
const s = serve({ port: 8080 });
console.log("First deno example! Running on http://localhost:8080/");
for await (const req of s) {
  req.respond({ body: "Hello World
" });
}

Run the program: deno run example.ts If you encounter a permission error such as "PermissionDenied: network access to \"0.0.0.0:8000\"", re‑run with the appropriate flag: deno run --allow-net example.ts The console will then output:

First deno example! Running on http://localhost:8080/

Is Node.js Dead?

It is too early to say. While Deno offers a cleaner, more thoughtfully designed runtime, Node.js remains widely used in production, benefits from a large community, and is more mature.

For more information, visit https://deno.land/ .

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

TypeScriptJavaScriptInstallationDeno
JavaScript
Written by

JavaScript

Provides JavaScript enthusiasts with tutorials and experience sharing on web front‑end technologies, including JavaScript, Node.js, Deno, Vue.js, React, Angular, HTML5, CSS3, and more.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.