DEV Community

Discussion on: Deno for JavaScript Beginners

Collapse
 
yuripredborskiy profile image
Yuri Predborskiy

I still don't get it. 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.

Next, module reusability between projects. Why? Every modern project I've used relies on docker containers or something similar, so there's no reusability, ever. And if you run the app in the cloud, it will, most likely, use a dedicated compute unit for that one app, which just takes this "killer feature" and throws it out the window.

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?

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?

To me de-no so far seems not like "destroys node" but more like "node backwards". Hopefully it will grow from this point into something i can pick up and use for a corporate environment because it provides some killer features node simply doesn't have, instead of just trying to be different.

There's one killer feature i see so far - running type script natively. But, at the same time, I don't use TS. Not yet, at least.

I wonder which one happens sooner - deno getting some great use cases or node getting native TS support with debugging out of the box, with no transpiling necessary.

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. You write your TS code in a web page and it executes elsewhere. Seems interesting to me personally - I won't have to install it locally and will have a chance to run the fiddle without transforming TS to js. Can it be used like that?

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