
From the creator of Node.js, Deno is a secure runtime for JavaScript and TypeScript that addresses Node’s shortcomings
If, npm from Node.js package manager doesn’t good enough to you, or you need a more secure JavaScript runtime environment than Node.js, take a look at new open source project Deno. But pay attention as a Deno is still under development.
Deno is a program for running JavaScript and TypeScript code outside of a browser. It’s the most recent effort spearheaded by Ryan Dahl, who founded the Node.js project in 2009, and it is an attempt to reimagine Node.js in light of the advances in JavaScript since 2009, including the TypeScript compiler. Like Node.js, Deno is essentially a shell around the Google V8 JavaScript engine although unlike Node.js it includes the TypeScript compiler in its executable image.
Deno secure stuff
The way Deno improves security vs Node is simple. Deno by default don’t let program access to a disk, network, subprocesses, or environmental variables. In Case you definitely want to allow any of these, you can add it with a command-line flag, which can be as granular as you like.
Example:
allow-red=/tmp or --allow-net=yandex.com
Another security trick is that Deno dies on uncaught errors, unlike Node.js which allow proceeding with uncaught error, with results that may not be predictable.
I Deno, we load ES modules using the import keyword and explicitly state the URL.
Example
import * as log from "https://deno.land/std/log/mod.ts"
Deno modules can be hosted anywhere – there is no centralized repository for third-party modules.
At the end of, after that, what we will have a released version we will have the capacity for building small private scripting projects in JavaScript and TypeScript
0 Comments