79760473

Date: 2025-09-10 04:48:56
Score: 0.5
Natty:
Report link

npm init itself doesn’t have a flag to auto-set "type": "module" in package.json. By default, it creates CommonJS projects.

So, there’s no direct npm init flag for "type": "module". The simplest automated way is:

npm init -y && npm pkg set type=module

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Abhishek Mishra