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
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
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!
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
Add the line to index.js
:
console.log('Hello, world.');
You can run it:
$ deno run index.js
Hello, world.
Top comments (0)