← 返回命令列表

Linux command

npm-author 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Set author name

npm config set init-author-name "[Your Name]"

Set author email

npm config set init-author-email "[email@example.com]"

Set author URL

npm config set init-author-url "[https://example.com]"

View author config

npm config get init-author-name

说明

npm-author is a configuration concept rather than a standalone subcommand: it refers to the `init-author-*` keys read by npm init (and npm create) when populating the `author` field of a new `package.json`. Setting these values with npm config set once — typically in the user-level `~/.npmrc` — saves retyping them every time a new package is initialized. They can also be set per-project via a local `.npmrc`. The underlying config keys are unset by default; if they are empty, `npm init` prompts for a value interactively.

参数

init-author-name
Package author name.
init-author-email
Package author email.
init-author-url
Package author URL.
init-license
Default SPDX license id for new packages (default: `ISC`).
init-version
Default semver version for new packages (default: `1.0.0`).

FAQ

What is the npm-author command used for?

npm-author is a configuration concept rather than a standalone subcommand: it refers to the `init-author-*` keys read by npm init (and npm create) when populating the `author` field of a new `package.json`. Setting these values with npm config set once — typically in the user-level `~/.npmrc` — saves retyping them every time a new package is initialized. They can also be set per-project via a local `.npmrc`. The underlying config keys are unset by default; if they are empty, `npm init` prompts for a value interactively.

How do I run a basic npm-author example?

Run `npm config set init-author-name "[Your Name]"` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does init-author-name do in npm-author?

Package author name.