DEV Community

Discussion on: Deno for JavaScript Beginners

Collapse
 
maximousblk profile image
Maximous Black

You get rid of node modules, and replace it with... Global folder for cached modules? So, basically you just moved node modules folder out of your project folder...

Exactly. Yes it doesn't help with deployment but it does help while development.

Making deno require access to everything seems cool at first, annoying at second thought. Like, why? Why do you want to limit it to a local folder only? It looks like a sandbox. My little private sandbox... Because js is so unsafe you have to build a bunker to run it?

The fact that Deno allows you to run and install scripts from anywhere on the internet makes it necessary. This probably wasn't the main reason it was made for. Yes it is annoying but you can eliminate that with makefiles or velociraptor (Deno's solution to npm scripts).

One other use case would be if you are working on a project that handles sensitive information, you want to have control over what the project can do. This ensures you don't leak anything during development and you can work with more confidence.

By the way if it needs permissions to access anything, how many permissions does it need to grab a url with an external module? One, to connect to internet? One, to connect to locally cached file or two, to do both?

Deno doesn't need permissions to download and cache modules or to access the project folder. To do anything outside project folder, you need to give explicit permissions.

I also wonder if deno can be used as a sandbox for resources that run your js code for testing purposes, like jsfiddle or leetcode.

There are already online Deno playgrounds popping up. I can't recall at the moment but check out the discord server, they will definitely know many of them.


Thanks for spending time reading my article.

Some comments have been hidden by the post's author - find out more