DEV Community

Cover image for What is Deno? Getting started with Deno
Sasidharan
Sasidharan

Posted on • Edited on

7 4

What is Deno? Getting started with Deno

Deno v1 was released recently, created by Ryan Dahl who is known for the creator of Node. Will it replace the node?

Deno a new javascript runtime for the backend but now it’s written in Rust, not C++, in addition to that supports Typescript. The coolest thing about Deno is it doesn’t have heaviest node modules replaced by linking third-party snippets in code directly using its source like the web.

How secure is this?

Deno created by thinking the security most in mind. Like by default, no file, network, or environment access, unless explicitly enabled.

$ deno run — allow-read=/etc https://deno.land/std/examples/cat.ts /etc/passwd
$ deno run — allow-read=/etc myFile.ts
Enter fullscreen mode Exit fullscreen mode

no more npm!

Most people prefer npm because it’s just like that, we can install and use third-party modules.

In Deno, the source of the repository should be imported to use it.

import { copy } from “https://deno.land/std@0.50.0/fs/copy.ts";
Enter fullscreen mode Exit fullscreen mode

Rather you can import all third-party dependencies in a single file because package.json is no more here.

For the first time, Deno will download the modules and cache it.

$ deno run — allow-read — allow-write main.ts
Compile file:///dev/deno/main.ts
Download https://deno.land/std@0.50.0/fs/copy.ts
Download https://deno.land/std@0.50.0/fs/ensure_dir.ts
Download https://deno.land/std@0.50.0/fs/_util.ts
.
.
Enter fullscreen mode Exit fullscreen mode

If you want to clear and download it again, you can run it with -- reload flag:

--reload
Enter fullscreen mode Exit fullscreen mode

or update a specific package like this,

-- reload=https://deno.land/std/fs/copy.ts
Enter fullscreen mode Exit fullscreen mode

Conclusion

As mentioned in the title, will it replace Node?
No. Deno is an idea in mind made by clearing all the flaws in Node. A huge community and large scale applications were built using Node.

May be from now, people will use it in their hobby projects and make it as an alternative to Node.

Follow @sasiKdharan

Neon image

Serverless Postgres in 300ms (❗️)

10 free databases with autoscaling, scale-to-zero, and read replicas. Start building without infrastructure headaches. No credit card needed.

Try for Free →

Top comments (0)

Neon image

Next.js applications: Set up a Neon project in seconds

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Get started →

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, cherished by the supportive DEV Community. Coders of every background are encouraged to bring their perspectives and bolster our collective wisdom.

A sincere “thank you” often brightens someone’s day—share yours in the comments below!

On DEV, the act of sharing knowledge eases our journey and forges stronger community ties. Found value in this? A quick thank-you to the author can make a world of difference.

Okay