DEV Community

Alberto Beiz
Alberto Beiz

Posted on

Exploring Denoland #1 - My first stomps with DENO

Sooo Deno 1.0 just launched. I have 0 knowledge about it but I’m curious to see what it has to offer.

As the seasoned software developer that I am, let’s start as usual:

Alt Text looks promising, let’s execute the installation command:

curl -fsSL | sh
Deno was installed successfully

That was fast and easy. After adding needed variables to my .bash_profile I can see my deno version:

$ deno --version
deno 1.0.0
v8 8.4.300
typescript 3.9.2

Soooooo let’s try

$ deno run
Welcome to Deno 🦕

That’s useful...and scary...but they say it’s secure so ¯_(ツ)_/¯

Ok last test in is the classic web server. I create a new test.ts file, copy the code:

import { serve } from "";
const s = serve({ port: 8000 });
for await (const req of s) {
 req.respond({ body: "Hello World\n" });

and run $ deno test.ts

ERROR...It’s $ deno run test.ts

ERROR Uncaught PermissionDenied: network access to "", 
run again with the --allow-net flag

Here is the security, I have to explicitly allow Deno access to network requests:

$ deno run test.ts --allow-net 

ERROR...what about...

$ deno run --allow-net test.ts 

SUCCESS --- Hello Denoland

End of exploration #1

  • Native Typescript support 💙💙💙💙
  • I like the idea of a strong and controlled standard library.
  • No package.json, fixed urls for packages. What about updating?

Have you tried Deno? Any thoughts about it?


Top comments (1)

javaarchive profile image

Maybe sometime all of the cdns will host a copy of deno because if goes down the first time someone runs a script that would be a problem.