DEV Community

Cover image for Say hello to Deno
sakethk
sakethk

Posted on • Edited on

Say hello to Deno

Deno is a Javascript runtime. Some devs will say that it is an alternative for NodeJS but it is not an alternative it is unique.
Ryan Dahl the creator of Nodejs created this Deno.

NODE -> NO DE -> DE NO -> DENO

Why Deno

  • It is secure (It wont give direct access for files, environment and Network etc. User needs to give permissions to use)
  • Supports Typescript
  • Gives single executable file
  • It had built-in utils like code formatter and inspector
  • Uses V8 runtime
  • Built in rust
  • No need npm
  • package.json not required
  • dependency manager not at all required
  • Gives Zero dependency build

Installation

Linux/Unix/OS X :

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

Windows Powershell :

iwr https://deno.land/x/install/install.ps1 -useb | iex
Enter fullscreen mode Exit fullscreen mode

Other ways :

#Using Brew(MAC OS)
brew install deno
#Using Chocolatey (Windows)
choco install deno
Enter fullscreen mode Exit fullscreen mode

Running First Deno program

deno run https://deno.land/std/examples/welcome.ts
Enter fullscreen mode Exit fullscreen mode

Hello World with colored text on console

create a file name it helloworld.js

import clc from 'https://deno.land/x/color/index.ts'
console.log(clc.red.text("Hello World"))
console.log(clc.blue.text("Hello World"))
Enter fullscreen mode Exit fullscreen mode

Run the following commands to run your first Deno program

deno run helloworld.js
Enter fullscreen mode Exit fullscreen mode

Top comments (0)