Deno 1.0 is out!

Robert - May 14 '20 - - Dev Community

Disclaimer

Don't panic. Node isn't going anywhere.

What is Deno?

From deno.land:

Deno is a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust.

  • Secure by default. No file, network, or environment access, unless explicitly enabled.
  • Supports TypeScript out of the box.
  • Ships only a single executable file.
  • Has built-in utilities like a dependency inspector (deno info) and a code formatter (deno fmt).
  • Has a set of reviewed (audited) standard modules that are guaranteed to work with Deno: deno.land/std

But why!?

From Ryan Dahl:

JavaScript has changed significantly since Node was designed in 2009. Notably:

  • Promises / Async / Await
  • ES Modules
  • Typed Arrays

Node has problems:

  • A poorly designed module system, with centralized distribution.
  • Lots of legacy APIs that must be supported.
  • Security

(These problems aren't unique to Node. Python and Ruby suffer similary)

Ryan Dahl's HolyJS talk

Installation

Using shell

curl -fsSL https://deno.land/x/install/install.sh | sh
Enter fullscreen mode Exit fullscreen mode

Using homebrew

brew install deno
Enter fullscreen mode Exit fullscreen mode

Getting Started

A sample http server

import { serve } from "https://deno.land/std@0.50.0/http/server.ts";
const s = serve({ port: 8000 });
console.log("http://localhost:8000/");
for await (const req of s) {
  req.respond({ body: "Hello World\n" });
}
Enter fullscreen mode Exit fullscreen mode

Blog post: https://deno.land/v1

. . . . . . . . . . . . . . . . . . .
Terabox Video Player