-2

I was reading an article about Deno vs Node on Medium, and I came across this section:

The main problem here is that the module system isn’t compatible with browsers. That is the reason for storing dependencies in node_modules and having a package.json.

What does it mean that Node.js is not compatible with browsers? Could someone clarify and provide additional details/resources?

DᴀʀᴛʜVᴀᴅᴇʀ
  • 7,681
  • 17
  • 73
  • 127
325
  • 594
  • 8
  • 21

1 Answers1

2

What is meant in the article is that Deno uses a more standard module system (ES modules) than Node.

This makes it easier to write modules that are usable in apps that run in Deno as well as apps that run in a browser, since modern browsers also support ES modules.

Jesper
  • 202,709
  • 46
  • 318
  • 350
  • 2
    ES modules is not just "a more standard module system", it's "the standard module system". – jsejcksn Sep 09 '21 at 20:38
  • I don't think that's the actual problem described in the article. Node.js supports ES modules for many years. The actual problem is that Node.js stores the modules in `node_modules` and imports them from there while browsers and Deno import the modules from a URL. – jabaa Sep 17 '21 at 08:14