by etamponi · 4y ago · 0 comments
Anyway: I think the underlying problem is that it has been hidden that Node is NOT JavaScript. It uses (some) of the JavaScript syntax, but it doesn't use its standard library, and its not guaranteed that a Node package will also run on the browser.
Deno tries to fix it. But I think everyone should ask themselves: is it really worth it? The backend and the browsers are two different environments with different needs. Why making novices think that the two are interchangeable, just to disappoint them a few moments later?
If your claim is "you're on the backend, you have saner options" then I would agree, but this isn't really about beginners.
Deno did something smart: all the non-web-compatible APIs are under the Deno package. That's great, and almost fixes the issue I am highlighting.
If Node could do the same, and provide a way to find at "compile time" (that is, statically), if a package is web-compatible or not, that would be very good.
My issue has probably more to do with npm than with Node itself.
Not to mention that splitting the ecosystem down the middle would result in less high quality modules that can fit your specific usecase!