Ever wished Node was more secure and came with TypeScript support out the box? Deno offers this and more. Learn why many are switching from Node to Deno.

In this article, we’ll explore Deno, a relatively new tool built as a competitor/replacement for Node.js that offers a more secure environment and comes with TypeScript support out the box.

We’ll use Deno to build a command-line tool to make requests to a third-party API — the Star Wars API — and see what features Deno provides, how it differs from Node, and what it’s like to work with.

Deno is a more opinionated runtime that’s written in TypeScript, includes its own code formatter (deno fmt), and uses ES Modules — with no CommonJS require statements in sight. It’s also extremely secure by default: you have to explicitly give your code permission to make network requests, or read files from disks, which is something Node allows programs to do by default. In this article, we’ll cover installing Deno, setting up our environment, and building a simple command-line application to make API requests.

As ever, you can find the code to accompany this article on GitHub.

#deno #node #javascript #typescript

How to Fetch Data from a Third-party API with Deno
1.90 GEEK