You need to tell Node to use the format by either naming your file `.mjs` or setting `"type": "module"` in your `package.json` file.
> Also why do so many libraries have this strange 5 line header code for this umd, amd, business. Is that to make their packages work with nodejs?
That's just old for "adapt the module system" from the old days and libraries just didn't bother updating.
I still use amd in my job at Microsoft though for some things so I guess it's not useless :)