ESM vs CommonJS in your Node Projects

preview_player
Показать описание
In this video, we'll convert one of our TypeScript Express templates to use ES Modules instead of CommonJS and explain the differences between the two systems alo

Don't forget to like this video and subscribe to our channel – we're publishing more videos and walkthroughs every week. Comment below and let us know what you'd like to see next!

Рекомендации по теме
Комментарии
Автор

THANK YOU! Watched the first minute of the video and you already helped solve by bug! God bless you :)

Ibrahim-
Автор

The link for the github repo in the description is empty. Can you please share it with us?

GeorgiGrigorov-ny
Автор

i dont like adding .js inside .ts files it feels wrong, can we avoid it natively without some tooling package?

Oblivianos
Автор

Hi, trying to get a bit more in this topic as I ignored it completely until now in my professional life. Could you include a view words about the pros and cons with using ESM or CommonJS? That's kind of what I expected from the titel. My current knowledge is only, that ESM supports treeshaking which could reduce your js package. That's why we're considering ESM over Common. But as stated, ESM has some "drawbacks" as the stated, "weird" import statements, less variables in node and so one.

Could you clear that topic up a little bit, either with a follow up or just in text form? Thanks already!

sr-juhahn