Deno Tutorial

Deno is a JavaScript/TypeScript runtime with security by default. Deno tends to substitute Node.js with a simpler, modern, and more secure runtime.

Deno is built on V8, Rust, and Tokio, a Rust asynchronous runtime environment. It aims to be a productive and secure scripting environment for the modern world of programming, Deno is for you!

If you want to learn Deno you are in the right section.

Our Deno tutorial is designed for simplicity. We also have tons of examples to get you in the game.

Deno Online Editor

Our real time Deno online editor lets you write and run Deno programs on your browser. It's a fast and efficient way to get on with Deno.

  Do It Yourself

Deno Example Code

function generateRandom(max_number) {
  return Math.ceil(Math.random() * max_number);
}

console.log(generateRandom(5));

  Do It Yourself

What Can Deno Do?

Deno is a JavaScript/TypeScript runtime environment, this means that you can use Deno to process server-side actions by writing JavaScript or TypeScript. Think of anything that other server-side programming languages can do.

  • Deno can serve web pages dynamically (like PHP, NodeJS, ASP, and other server-side languages).
  • Deno can create, open, read, write, delete, and close files on the server
  • Deno can be used to build command-line based applications
  • Deno can interact with any kind of database

Why Use Deno?

Think of anything that other server-side programming languages can do, then think security, simplicity, and modernization with Deno.

  • Security by default. No file, network, or environment access (unless explicitly enabled).
  • It is a TypeScript runtime, which means it supports TypeScript out of the box.
  • Comes with a single executable (deno).
  • Ships with built-in tools that make code inspection and formatting easy,  the deno info and deno fmt.
  • You can bundle scripts into a single JavaScript file and more.

Who Can Learn Deno?

Deno can be learned by anyone, provided that you have the basic knowledge of JavaScript especially about async/await.

Comparisons to Node.js

Deno NodeJS
No package manager. Uses modules referenced as URLs or file paths Has a package manager called npm
Deno does not use package.json in its module resolution algorithm Uses package.json
All async actions in Deno return a promise. Thus Deno provides different APIs than Node. In Node.js, async can be promise or function-based
Deno requires explicit permissions for file, network, and environment access (for security purposes). Node.js does not require this.
Deno always dies (exits) on uncaught errors Node.js may not die.
Uses "ES Modules" and does not support require(). Third-party modules are imported via URLs: import * as log from "https://deno.land/std/log/mod.ts"; Node.js uses both require() and the ES import.

You can start our Deno Tutorial by clicking the 'Next Chapter' button below.

What You Should Know at the End of This Lesson

  • You should understand when Deno is.
  • You should understand the core value of Deno (security, speed, and modern).
  • You should know that Deno is TypeScript-code and the standard file extensions are .js and .ts