-
Notifications
You must be signed in to change notification settings - Fork 246
Closed
Description
Motivation ("The Why")
The type
field is used by many folks to be explicit about the how Node.js interprets the .js
extension. It would be great if we could set this field by default, likely to commonjs
and give folks the ability to overwrite the default with module
(or any other future module type)
Example
{
"type": commonjs"
}
How
Current Behaviour
Currently this is the default output of npm init --yes
{
"name": "$FOLDERNAME",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "$USERNAME <$EMAIL>",
"license": "ISC"
}
Desired Behaviour
{
"name": "$FOLDERNAME",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "$USERNAME <$EMAIL>",
"license": "ISC",
"type": "commonjs"
}
References
https://nodejs.org/dist/latest-v14.x/docs/api/packages.html#packages_type
electrovir
Metadata
Metadata
Assignees
Labels
No labels