11684 shaares
392 private links
392 private links
The author creates a project to gather statistics about the top most starred projects on Github or the most downloaded packages on NPM.
- 9-27% of JS/TS projects declare themselves to be ES Modules
- Less than 6% of JS/TS files declare that they are ES Modules via the
.mjs,.cjsor.mtsfile extensions.
Some ideas:
- kill
.mjs,.cjsand.mtsshould be replaced by thetype="module"in package.json. Let's stick to.js,.jsx,.tsand.tsx - Make
type="module"the default and warns when the type is not set to module. - We should upgrade the most common libraries used by the community to ES Modules
- The NPM registry can require an explicit module field on new packages, making it clear when a package intentionally uses CommonJS.
- NodeJS can officially drop support for
requireandmodule.exportsin a future version, creating a bit more pressure to migrate.