Skip to content

Commit 03912db

Browse files
authoredSep 20, 2023
docs: add init-specific params to init docs/help (#6819)
Closes npm/init-package-json#21
1 parent 8088325 commit 03912db

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed
 

‎lib/commands/init.js

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ const BaseCommand = require('../base-command.js')
1616
class Init extends BaseCommand {
1717
static description = 'Create a package.json file'
1818
static params = [
19+
'init-author-name',
Has a conversation. Original line has a conversation.
20+
'init-author-url',
Has a conversation. Original line has a conversation.
21+
'init-license',
Has a conversation. Original line has a conversation.
22+
'init-module',
Has a conversation. Original line has a conversation.
23+
'init-version',
Has a conversation. Original line has a conversation.
1924
'yes',
2025
'force',
2126
'scope',

‎tap-snapshots/test/lib/commands/publish.js.test.cjs

+1
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ exports[`test/lib/commands/publish.js TAP re-loads publishConfig.registry if add
315315
`
316316

317317
exports[`test/lib/commands/publish.js TAP respects publishConfig.registry, runs appropriate scripts > new package version 1`] = `
318+
318319
`
319320

320321
exports[`test/lib/commands/publish.js TAP restricted access > must match snapshot 1`] = `

‎tap-snapshots/test/lib/docs.js.test.cjs

+8-1
Original file line numberDiff line numberDiff line change
@@ -3160,7 +3160,9 @@ npm init <package-spec> (same as \`npx <package-spec>\`)
31603160
npm init <@scope> (same as \`npx <@scope>/create\`)
31613161
31623162
Options:
3163-
[-y|--yes] [-f|--force] [--scope <@scope>]
3163+
[--init-author-name <name>] [--init-author-url <url>] [--init-license <license>]
3164+
[--init-module <module>] [--init-version <version>] [-y|--yes] [-f|--force]
3165+
[--scope <@scope>]
31643166
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
31653167
[-ws|--workspaces] [--no-workspaces-update] [--include-workspace-root]
31663168
@@ -3175,6 +3177,11 @@ npm init <@scope> (same as \`npx <@scope>/create\`)
31753177
aliases: create, innit
31763178
\`\`\`
31773179
3180+
#### \`init-author-name\`
3181+
#### \`init-author-url\`
3182+
#### \`init-license\`
3183+
#### \`init-module\`
3184+
#### \`init-version\`
31783185
#### \`yes\`
31793186
#### \`force\`
31803187
#### \`scope\`

‎workspaces/config/lib/definitions/definitions.js

+6
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,7 @@ define('include-workspace-root', {
963963

964964
define('init-author-email', {
965965
default: '',
966+
hint: '<email>',
966967
type: String,
967968
description: `
968969
The value \`npm init\` should use by default for the package author's
@@ -972,6 +973,7 @@ define('init-author-email', {
972973

973974
define('init-author-name', {
974975
default: '',
976+
hint: '<name>',
975977
type: String,
976978
description: `
977979
The value \`npm init\` should use by default for the package author's name.
@@ -981,13 +983,15 @@ define('init-author-name', {
981983
define('init-author-url', {
982984
default: '',
983985
type: ['', url],
986+
hint: '<url>',
984987
description: `
985988
The value \`npm init\` should use by default for the package author's homepage.
986989
`,
987990
})
988991

989992
define('init-license', {
990993
default: 'ISC',
994+
hint: '<license>',
991995
type: String,
992996
description: `
993997
The value \`npm init\` should use by default for the package license.
@@ -997,6 +1001,7 @@ define('init-license', {
9971001
define('init-module', {
9981002
default: '~/.npm-init.js',
9991003
type: path,
1004+
hint: '<module>',
10001005
description: `
10011006
A module that will be loaded by the \`npm init\` command. See the
10021007
documentation for the
@@ -1008,6 +1013,7 @@ define('init-module', {
10081013
define('init-version', {
10091014
default: '1.0.0',
10101015
type: semver,
1016+
hint: '<version>',
10111017
description: `
10121018
The value that \`npm init\` should use by default for the package
10131019
version number, if not already set in package.json.

0 commit comments

Comments
 (0)
Please sign in to comment.