An Introduction to Deno

A secure runtime for JavaScript and TypeScript. — by (Deno.land)[https://deno.land/]

Since you are reading this blog, I would assume that you may have probably worked using Node.JS or maybe coming from Javascript development background.

Before (Node.JS)[https://nodejs.org/en/], Javascript world was somewhat unorganized, the only bigger movement we had were jQuery and Backbone (though there are some other smaller movement worth mentioning like Prototype.JS, etc)

Deno

Node.JS was a big thing that happened to Javascript community, it pushed it toward an organized community like other programming languages. But before Node.JS, most of developer had programming language as their core development work. We rarely used to find a developer who used to work in Javascript full-time.

Node.JS changed that scenario, people started taking Javascript seriously and that improved Javascript significantly and we have seen Javascript ecosystem evolved with Webpack, ReactJS, Angular, Vue.JS in front-end and Express.JS in the backend. But since then it had a lot of hiccups. We all can recall callback hell, node_modules being heavy and npm modules with unnecessary dependencies and code. This made backend development as a nightmare and that’s why nowadays you mostly see Node mostly being used as ecosystem manager rather than a complete server-side JS ecosystem as imagined initially.

To overcome these hurdles Ryan Dahl came with reimagining server-side JS with (Deno)[https://deno.land/]. Here are few things that may catch your attention and help you differentiate Deno from NodeJS

So far so good, going by specs it does look promising and we are moving back to old Javascript simplicity, security while catching with the world of technologies.

Installation

Deno ships as a single executable with no dependencies. You can install it using your favorite installers, or download it from the releases page.

Shell (Mac, Linux):

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

PowerShell (Windows):

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

Homebrew (Mac):

brew install deno

Chocolatey (Windows):

choco install deno

Scoop (Windows):

scoop install deno

Build and install from source using Cargo

cargo install deno

First Program

Once you have installed Deno, please run post-install instructions if any, or you are good to go. Source your bashrc or bash_profile or restart your terminal. Run the following command

deno run https://deno.land/std/examples/welcome.ts

you should see something like this

Download https://deno.land/std/examples/welcome.ts
Warning Implicitly using master branch https://deno.land/std/examples/welcome.ts
Compile https://deno.land/std/examples/welcome.ts
Welcome to Deno 🦕

You are good to go now. Keep watching this space for more updates. Thanks for reading