Comparison of JavaScript modules
JavaScript has been around since 1995. In that time there have been several different ways to create modules. Due to browser compatibility issues and legacy codebases, all of these module types are still in use today.
What is a module?
A module is so...
joeattardi.dev12 min read
shadowtime2000
I program
Your ES modules examples weren't exactly ES modules. I believe in the actual specification you had to have
.jsextensions in imports and you can only import from URLs and relative paths. It was module bundlers which popularized the syntax you are using which is kind of the same as with NodeJS. If you are using a bundler you can import a library from it's name, if you aren't you have import it from an NPM CDN such as skypack.