Node.js—I just learned that there is:
npm init --init-type=module --yes
But it doesn’t help much. I’ll probably continue to use `npm init` without that flag and change "commonjs" to "module" manually.
It feels like npm could switch to "module" as the default now.
npm init --init-type=module --yes
But it doesn’t help much. I’ll probably continue to use `npm init` without that flag and change "commonjs" to "module" manually.
It feels like npm could switch to "module" as the default now.
Comments
however you can put `init-type=module` in ~/.npmrc if you want to set it and forget it, altho i would *strongly* suggest using .mjs instead, since type module doesn't give any benefits except subverting what ".js" means (and adds a perf hit)
“npm init esm” for that one