To be fair, only thanks to JavaScript/TypeScript compilation and polyfills to AMD and CJS pseudo modules approach, only recently has nodejs supported ES6 modules without having to deal with switches.
To be fair, only thanks to JavaScript/TypeScript compilation and polyfills to AMD and CJS pseudo modules approach, only recently has nodejs supported ES6 modules without having to deal with switches.
I've been using modules in nodejs for a very long time. What sucked initially was that you had to use a command line flag at first, and it still sucks that you have to use the mjs extension. Still, those are minor issues compared to the issues modules face in C++. And in browsers, modules worked nicely almost from the start, and since import maps you don't even need to use any kind of build system amymore.
Likewise I have been using C++ modules for my C++ hobby coding since VS 2019 prototype introduction, despite all the warts.
Nowadays, with exception of header units, VC++ and clang alongside MSBuild and CMake/ninja are pretty much usable for anyone that is able to stick to a specific platform.
I don't consider still fighting with build tools options in 2025 to make a pleothora of npm dependencies happy to run under nodejs a minor issue.