Deno Tutorial
Deno Startup
Starting up with Deno is very simple. Deno is a secure JavaScript and TypeScript runtime, this means Deno does not introduce another new programming language but uses an already existing, popularly known programming language JavaScript. You can also power the Deno by using TypeScript (a typed superset of JavaScript that compiles to plain JavaScript.).
Working With Deno
Deno is a single binary executable file that works with all major operating systems: macOS, Linux, and Windows. Unline Node.js, Deno has no external dependencies.
Download and install Deno
The easiest way to download and install Deno is by using deno_install
. This provides convenience scripts to download and install the binary.
Download Deno on macOS and Linux
To download and install Deno on your macOS or Linux computer:
Step 1
Open your terminal by pressing Ctrl + Option + Shift + T on macOs or Ctrl + Alt + T on Linux
Step 2
Run the code below in your terminal
curl -fsSL https://deno.land/x/install/install.sh | sh
Download Deno on Windows Using Powershell
To download and install Deno on your Windows computer using Powershell:
Step 1
To open Powershell on Windows, press Ctrl + Shift + Enter
Step 2
Run the code below in your Powershell terminal
iwr https://deno.land/x/install/install.ps1 -useb | iex
Download Deno on Windows Using Scoop
To download and install Deno on your Windows computer using Scoop:
Step 1
Open Powershell on Windows by pressing Ctrl + Shift + Enter
Step 2
Run the code below in your Powershell terminal
scoop install deno
Download Deno on Windows Using Chocolatey
To download and install Deno on your Windows computer using Chocolatey:
Step 1
To open Powershell on Windows, press Ctrl + Shift + Enter
Step 2
Run the code below in your Powershell terminal
choco install deno
Download Deno on macOS Using Homebrew
To download and install Deno on macOS using Homebrew:
Step 1
Open your terminal by pressing Ctrl + Option + Shift + T on macOS
Step 2
Run the code below in your terminal
brew install deno
Download Deno on macOS, Linux and Windows Using Cargo
To download and install Deno on macOS, Linux and Windows using Cargo:
Step 1
Open your terminal by pressing Ctrl + Option + Shift + T on macOS or Ctrl + Alt + T on Linux or Ctrl + Shift + Enter on Windows (Powershell).
Step 2
Run the code below in your terminal
cargo install deno
The above processes should show download progress that lets you know when Deno is installed. The final success display on Linux should look like the image below:
Download Deno Manually on macOS, Linux and Windows
Deno has a script that can be used to also download and installed Deno manually, by downloading a zip file at github.com/denoland/deno/releases. These packages contain just a single executable file.
Test Deno
Now that you have Deno downloaded and installed on your computer, the next step is to test it to make sure all is working fine.
To test your installation, run deno --version
. If this prints the Deno version to the console the installation was successful!
Run a Code
Open your terminal and type deno, a Deno interactive terminal will appear, type in the following code.
console.log('Hello, Welcome Deno!');
What You Should Know at the End of This Chapter
- You should be able to install and start running the Deno program on your computer.