Deno has hit the waves since it was released on 13th May 2020, and the question some of us are asking right now is, "What is Deno?"
Deno is an improved version of Node.js. I know you might be familiar with Node.js, so Deno came into the light to do what Node.js could do but do it much better with improved features.
Deno was announced almost 2 years ago by Ryan Dahl who is also the creator of Node.js after saying he had some regrets on Node.js
Features of Deno
Those are just some of the features it has.
Does this mean now Node.js is going into the pit?
The answer all depends on the user, but if you get to try Deno I don't think you'll ever go back to Node.js
Why Learn Deno
As opposed to Node.js which was written in C++, Deno is written in Rust and TypeScript which makes it easier to work with TypeScript when using Deno
Similarities between Deno with Node.js
Both are good for server-side development
Both are developed on the V8 Engine
Differences between Deno and Node.js
Deno is written in Rust and TypeScript. Node.js is written in C++
Deno doesn't have a package manager, you import ES modules from URLs. Node.js has an official package manager called npm.
Deno offers sandbox security layer through permissions. Node.js can access anything a user can access
Deno uses modern ECMAScript features in its API and standard library. Node.js uses callbacks-based standard library.
We have couple if ways to install deno:
Using Shell (macOS, Linux):
$ curl -fsSL https://deno.land/x/install/install.sh | sh
Using PowerShell (Windows):
$ iwr https://deno.land/x/install/install.ps1 -useb | iex
Using Homebrew (macOS):
brew install deno
Using Chocolatey (Windows):
$ choco install deno
Using Scoop (Windows):
$ scoop install deno
Once that's done, set your path and check out the help command
We have a bunch of subcommands we can run, try them out...
bundle - this bundles module and dependencies of a project into a single file
cache - this caches the dependencies
doc- this shows documentation for a module
eval- this evaluates some code. Example
deno eval "console.log(5 + 5)"
completions- this generates shell completions
install- this installs script as executable
run - runs a program given url to the module or filename
repl- Read-Eval-Print-Loop (This is the default subcommand, and can be started by only typing
Those are just some of the subcommands Deno offers. You can also run help for a specific subcommand e.g
deno run --help
Running Deno App
Let's try something simple for the first time in deno
deno run https://deno.land/std/examples/welcome.ts
The above code outputs
Welcome to Deno 🦕
If you click on the link we executed you get this a simple TypeScript Code..
You can try fhe other examples available in the Deno websites, check the out at https://deno.land/std/examples/.
That's all I had for you, hope you learned something.
See you soon
Top comments (0)