5 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ class Init extends BaseCommand {
19
19
'init-author-url' ,
20
20
'init-license' ,
21
21
'init-module' ,
22
+ 'init-type' ,
22
23
'init-version' ,
23
24
'yes' ,
24
25
'force' ,
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ exports[`test/lib/commands/config.js TAP config list --json > output matches sna
74
74
"init-author-url": "",
75
75
"init-license": "ISC",
76
76
"init-module": "{CWD}/home/.npm-init.js",
77
+ "init-type": "commonjs",
77
78
"init-version": "1.0.0",
78
79
"init.author.email": "",
79
80
"init.author.name": "",
@@ -237,6 +238,7 @@ init-author-name = ""
237
238
init-author-url = ""
238
239
init-license = "ISC"
239
240
init-module = "{CWD}/home/.npm-init.js"
241
+ init-type = "commonjs"
240
242
init-version = "1.0.0"
241
243
init.author.email = ""
242
244
init.author.name = ""
Original file line number Diff line number Diff line change @@ -854,6 +854,16 @@ more information, or [npm init](/commands/npm-init).
854
854
855
855
856
856
857
+ #### \`init-type\`
858
+
859
+ * Default: "commonjs"
860
+ * Type: String
861
+
862
+ The value that \`npm init\` should use by default for the package.json type
863
+ field.
864
+
865
+
866
+
857
867
#### \`init-version\`
858
868
859
869
* Default: "1.0.0"
@@ -2123,6 +2133,7 @@ Array [
2123
2133
"init-author-url",
2124
2134
"init-license",
2125
2135
"init-module",
2136
+ "init-type",
2126
2137
"init-version",
2127
2138
"init.author.email",
2128
2139
"init.author.name",
@@ -2357,6 +2368,7 @@ Array [
2357
2368
"init-author-url",
2358
2369
"init-license",
2359
2370
"init-module",
2371
+ "init-type",
2360
2372
"init-version",
2361
2373
"init.author.email",
2362
2374
"init.author.name",
@@ -3210,8 +3222,8 @@ npm init <@scope> (same as \`npx <@scope>/create\`)
3210
3222
3211
3223
Options:
3212
3224
[--init-author-name <name>] [--init-author-url <url>] [--init-license <license>]
3213
- [--init-module <module>] [--init-version <version >] [-y|--yes] [-f|--force ]
3214
- [--scope <@scope>]
3225
+ [--init-module <module>] [--init-type <type >] [--init-version <version> ]
3226
+ [-y|--yes] [-f|--force] [- -scope <@scope>]
3215
3227
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
3216
3228
[--workspaces] [--no-workspaces-update] [--include-workspace-root]
3217
3229
@@ -3230,6 +3242,7 @@ aliases: create, innit
3230
3242
#### \`init-author-url\`
3231
3243
#### \`init-license\`
3232
3244
#### \`init-module\`
3245
+ #### \`init-type\`
3233
3246
#### \`init-version\`
3234
3247
#### \`yes\`
3235
3248
#### \`force\`
Original file line number Diff line number Diff line change @@ -954,6 +954,14 @@ const definitions = {
954
954
more information, or [npm init](/commands/npm-init).
955
955
` ,
956
956
} ) ,
957
+ 'init-type' : new Definition ( 'init-type' , {
958
+ default : 'commonjs' ,
959
+ type : String ,
960
+ hint : '<type>' ,
961
+ description : `
962
+ The value that \`npm init\` should use by default for the package.json type field.
963
+ ` ,
964
+ } ) ,
957
965
'init-version' : new Definition ( 'init-version' , {
958
966
default : '1.0.0' ,
959
967
type : Semver ,
Original file line number Diff line number Diff line change @@ -231,6 +231,9 @@ Object {
231
231
"init-module": Array [
232
232
"valid filesystem path",
233
233
],
234
+ "init-type": Array [
235
+ Function String(),
236
+ ],
234
237
"init-version": Array [
235
238
"full valid SemVer string",
236
239
],
0 commit comments