5 Deno Main Features

Yusuf Akhsan H.
4 min readJun 13, 2020

--

Deno has been buming in social media and online forums lately, deno was made by the same person who made JS Node, namely Ryan Dahl. Deno is a runtime for javascript and typescript that uses the V8 engine and is made with Rust. Deno’s reason was created to answer the shortcomings that exist in the JS Node. This Yussan Academy video invites you to get to know Deno better by knowing its various advantages, the source is from the Deno homepage at https://deno.land.

Secure By Default

By default deno does not give some access to the computer / server that runs it. For simplicity, I give the following sample. There is a javascript that I run using deno and the contents of the script are API requests.

deno run file.js

When it starts, Deno will immediately get an error because when it is run we don’t give access to the network, the solution is to run with the following command.

deno run --allow-net file.js

Because the network has been ingested, the script above can run normally for API requests. Not only that limitation is given, but there are many more, such as access to read write a directory / file, and many more, you can check at https://deno.land/manual/getting_started/permissions.

Support TypeScript Of Out The Box

Since I first got to know Typescript I immediately fell in love, but when I wanted to use Typescript on JS Node there were a number of setup and installation dependencies that needed to be done. With Deno, then you only need to create typescript and run, then everything will be ok and run immediately.

Ships Only a Single Executable File

import { Router } from "https://deno.land/x/oak/mod.ts";
import getBeers from "./controllers/getBeers.js";
const router = new Router();router.get("/beers", getBeers);

An interesting thing that we can find in Deno is, it allows to import directly from the URL, so it doesn’t need to be installed first, npm install, yarn install and so on.

The example script above is to create a restful service, and pull the router directly from the url, so that when it is delivered to another developer or when it wants to be released, just simply run it.

Has Built-in Utilities

From the Deno homepage, there are 2 sample built-in utilities, namely deno info (deno isnpector) and deno fm (deno formatter).

Deno Info

With Deno Info, it allows developers to find out more about the modules they use, starting from the local storage, the location of the file map and what else they are depended to use.

Deno FMT

If you are already accustomed to using prettiers or linters and the like, the same concept is for deno fmt. Deno FMT can be directed directly to all files in the directory or targeted to specific files, of course, in accordance with the standard deno formater.

Has a Set of Reviewed (audited) Standard Modules

This point shows that all packages in https://deno.land/std are guaranteed to work well in Deno. These modules do not have external dependencies and are reviewed by the Deno core team. The aim is to have a set of high quality standard codes that can be used by all Deno projects without fear. Contributions are welcome!

Penutup

Yups that I just want to say about this Deno opener, to read more about Deno please read at https://deno.land/.

Source : https://yussanacademy.com/id/post/5-Fitur-Utama-Deno-5ee42f11a73de77e72736c1f

--

--

Yusuf Akhsan H.

if you do not want to do, don’t do. If you want to do, do it effectively and efficiently.