Upgrade to Pro — share decks privately, control downloads, hide ads and more …

deno.pdf

 deno.pdf

A presentation describing about Deno features.

prakhar-ira

March 25, 2020
Tweet

Other Decks in Programming

Transcript

  1. 3 / 11 What is Deno? Deno is runtime for

    executing JavaScript and TypeScript outside the browser in a single executable (denocode). Deno is secure by default, with no file, network, or environment access unless explicitly enabled. It is built on top of: • V8 • Rust • Tokio (event loop) • TypeScript
  2. 4 / 11 Why Deno, when node is there? Problems

    of using NodeJs: • 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 similarly)
  3. 5 / 11 How Deno attempts to correct design mistakes

    in Node. • ES modules are the one and only module system ◦ HTTP URLs are used to link to third party code ◦ Deno has the ability to fetch resources itself, so it is its own package manager. • Deno is secure by default ◦ Users must give extra permission to access the disk, network, or otherwise do privileged operations. • Deno maintains browser compatibility ◦ The subset of Deno programs which are written completely in JavaScript and do not use the global Deno object should also run in a modern web browser without change.
  4. 6 / 11 Examples import { serve } from "https://deno.land/[email protected]/http/server.ts";

    for await (const req of serve({ port: 8000 })) { req.respond({ body: "Hello World\n" }); } And you can run by deno run example.js. Other commands include: deno -h REPL deno --types cat program location.href import.meta