Is there an easy way to make `npm init -y` add `"type": "module"` to the newly created package.json?
-
Is there an easy way to make `npm init -y` add `"type": "module"` to the newly created package.json?
-
cthos 🐱replied to Zach Leatherman :11ty: last edited by
@zachleat Isn't that just `npm init esm -y`?
-
Zach Leatherman :11ty:replied to cthos 🐱 last edited by
@cthos no, doesn’t look like it.
```
{
"name": "initmod",
"version": "1.0.0",
"main": "index.js",
"module": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"esm": "^3.2.25"
}
}
```(and it creates more files too)
-
Zach Leatherman :11ty:replied to Zach Leatherman :11ty: last edited by
`npm init -y; npm pkg set type="module";` works well enough—thank you @chrisw_b!
via https://social.chriswb.dev/@chrisw_b/statuses/01J8QQEH8DT5EWSYY3ZMJPGZ0G
-
cthos 🐱replied to Zach Leatherman :11ty: last edited by
@zachleat Oops, hugged the server a bit too hard.
-
Zach Leatherman :11ty:replied to cthos 🐱 last edited by
@cthos who what where when
-
Jason Miller 🦊⚛️replied to Zach Leatherman :11ty: last edited by
-
Zach Leatherman :11ty:replied to Jason Miller 🦊⚛️ last edited by
@developit @chrisw_b get exciteddddd