DEV Community

Converting a Node project to Deno

Jota Feldmann on May 13, 2020

I was intrigued to test Ryan Dhal's Deno and nothing better than some personal project to make it right. Some important stuff before: Convert ...
Collapse
 
deejaydev profile image
Danjuma Ashiwaju •

@jotafeldmann - thanks for post I have a ReactJs project built with NPM + Webpack that needs to be updated, I would like to take get rid of its dependency on node_moudels and move to a Deno project instead would this be possible with your post as a guideline? if yes would it be a pain to do ie: time-consuming.

Collapse
 
jotafeldmann profile image
Jota Feldmann •

@autodidact_dev , unfortunately, no :( My article covers the aspects of a simple project. For your existent project, check the first links, start with medium.com/@mudgen/porting-node-js...

And please, share your experience as an article, whether possible.

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • • Edited

Do I need Makefile, and cmake or something, instead of package.json script section?

Collapse
 
jotafeldmann profile image
Jota Feldmann •

Hi Pacharapol :)

No, you don't need anything, just Deno.

I just use Makefile for convenience in all my projects.

Thanks for the feedback, I will update about it.

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • • Edited

But I love scripts section. Otherwise, I often have to write some kind of bash scripts.

*.yaml (like Pubspec.yaml) would be better than package.json, because it supports multi-line shell scripts.

Thread Thread
 
jotafeldmann profile image
Jota Feldmann •

Most of the common tasks come "out of the box" with Deno.

But for more custom/specific stuff (e.g. deploy) you need something like this. I'm using a Makefile for this kind of task.

Collapse
 
5422m4n profile image
Sven Kanoldt •

Nice. Any experience on stability and performance so far? How do you deal with dependencies that are not on Deno.land?

Collapse
 
jotafeldmann profile image
Jota Feldmann •

Hi Sven, thanks for the answer.

Regarding stability and performance, I can't tell due to the humble nature of my personal project.

Regarding the dependencies, I'm putting all stuff inside a make install task.

Collapse
 
5422m4n profile image
Sven Kanoldt •

Thanks for reply.
So your make install task will download and unpack the deps and put them into a local folder from where you use them? Or how does this work in your case?

Thread Thread
 
jotafeldmann profile image
Jota Feldmann •

Deno installs all dependencies in a centralized folder like \home\user\.deno. So we don't need to download every time, for all projects.

What you need to specify is the security flag.

I've made a make install for my convenience, to understand all dependencies of the project and pre-download in case of the production environment.

You can find more info here:

Collapse
 
garronej profile image
Garrone Joseph • • Edited

I think Denoify is worth mentioning here :)

meta