DEV Community

nabbisen
nabbisen

Posted on

Deno installation on Arch Linux

What is Deno? deno.land, the official website, tells shortly and impressively:

Deno is a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust.

The Github repository is here.

Here shows how to install it in Arch Linux. Really simple. Just use pacman like this:

# pacman -Sy deno
Enter fullscreen mode Exit fullscreen mode

Done.
Now deno is available with V8 engine and TypeScript in your computer:

$ deno --version
deno 1.12.1 (release, x86_64-unknown-linux-gnu)
v8 9.2.230.14
typescript 4.3.5
Enter fullscreen mode Exit fullscreen mode

What is next? There is the official getting started.
For example, run Deno program with a one-liner on the command line:

$ deno run https://deno.land/std/examples/welcome.ts
Download https://deno.land/std/examples/welcome.ts
Warning Implicitly using latest version (0.102.0) for https://deno.land/std/examples/welcome.ts
Download https://deno.land/std@0.102.0/examples/welcome.ts
Check https://deno.land/std/examples/welcome.ts
Welcome to Deno!
Enter fullscreen mode Exit fullscreen mode

Well, deno can execute a local index.js / index.ts just as Node.js can. However, it is notable that deno doesn't create package.json, package-lock.json and even node_modules directory!
Here is another example.

$ mkdir my-first-deno
$ cd my-first-deno
$ touch index.js # or index.ts
Enter fullscreen mode Exit fullscreen mode

Add the line to index.js:

console.log('Hello, world.');
Enter fullscreen mode Exit fullscreen mode

You can run it:

$ deno run index.js
Hello, world.
Enter fullscreen mode Exit fullscreen mode

Top comments (0)