DEV Community

Cover image for Simply Explained: Deno vs Node.js

Simply Explained: Deno vs Node.js

Shawn Humphreys on July 30, 2020

cover photo credits - Fernando Doglio Most JavaScript developers are familiar with Nodejs as it is a well-established and highly-respected technol...
Collapse
 
easrng profile image
easrng

I love the idea of deno because it brings web js and server is a lot closer together. Granted, you can't natively import typescript on the web, but it would be possible to have a service worker transpile the ts to js on the fly, making it work like deno.

Collapse
 
nemo011 profile image
Nemo

Hey! Nice article. You beautifully explained the topic. As a beginner, it often gets confusing whenever we hear a new name! Thank you for sharing. 😊

Collapse
 
mrshawnhum profile image
Shawn Humphreys

I am glad! I might continue to do this where I try to explain a topic as simple as I can. It has always been confusing for me in the beginning.

Collapse
 
nemo011 profile image
Nemo

That will be awesome! 😄

Collapse
 
kitarp29 profile image
Pratik Singh

Thanks Sir ,It was really helpful!!

Collapse
 
mrshawnhum profile image
Shawn Humphreys

I am glad it was! Thank you!

Collapse
 
hemant profile image
Hemant Joshi

I Love node

Collapse
 
mrshawnhum profile image
Shawn Humphreys

So do I!

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀 • Edited

If you want the deno experience for the web or you want to port node modules to deno, I am working on:

GitHub logo adam-cyclones / didi

Convert a project from common JS to ESmodules, with included bundler-like / task runner behaviour.

didi the dino is a pterodactyl logo

didi

A transpiler for JavaScript and Typescript, transforming CommonJS modules into distinct ES Modules

Who uses didi?

Frontend and deno developers will find didi useful.

Try it out.

didi is not ready for production however you can still take didi for a spin!

npm install -g @didi-js/client-didi-cli

# or

yarn global add @didi-js/client-didi-cli

Create a project an entry file, some installed node_modules and then require the browser dependency into your entry file using the base specifier.

const colorThief = require('colorThief'); // base specifier example, no paths needed

run didi path/to/example-project

The result should have output a new target directory within this example-project and also a server should have started on http://localhost:8086. You may see some console errors in the browser, this is normal for this stage.

You may also notice that your import looks like this:

import colorThief from "color-thief"; // still no path?
Collapse
 
andrewbaisden profile image
Andrew Baisden

All the more reason to learn and use TypeScript in future projects. Looking forward to when Deno becomes more stable.

Collapse
 
mrshawnhum profile image
Shawn Humphreys

Can't wait to get into Typescript!