OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Is there a way to "npm init" an ES module?

  • Thread starter Thread starter Lewis
  • Start date Start date
L

Lewis

Guest
All modern versions of Node need to run packages as modules is "type": "module" in package.json, but I don't see any flags for npm init or yarn init that will add that property.

Is there a flag for either package manager or an easy way to add the value to package.json (i.e., npm package-property set type module or something similar)?

<p>All modern versions of Node need to run packages as modules is <code>"type": "module"</code> in <code>package.json</code>, but I don't see any flags for <code>npm init</code> or <code>yarn init</code> that will add that property.</p>
<p>Is there a flag for either package manager <em>or</em> an easy way to add the value to <code>package.json</code> (i.e., <code>npm package-property set type module</code> or something similar)?</p>
 

Latest posts

Top