npm-version
选择命令行版本:
See Details
目录
概要
¥Synopsis
npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]alias: verison
配置
¥Configuration
allow-same-version
-
默认值:false
¥Default: false
-
类型:布尔值
¥Type: Boolean
防止在使用 npm version
将新版本设置为与当前版本相同的值时引发错误。
¥Prevents throwing an error when npm version
is used to set the new version to the same value as the current version.
commit-hooks
-
默认值:true
¥Default: true
-
类型:布尔值
¥Type: Boolean
使用 npm version
命令时运行 git commit hooks。
¥Run git commit hooks when using the npm version
command.
git-tag-version
-
默认值:true
¥Default: true
-
类型:布尔值
¥Type: Boolean
使用 npm version
命令时标记提交。将此设置为 false 会导致根本不进行任何提交。
¥Tag the commit when using the npm version
command. Setting this to false results in no commit being made at all.
json
-
默认值:false
¥Default: false
-
类型:布尔值
¥Type: Boolean
是否输出 JSON 数据,而不是正常输出。
¥Whether or not to output JSON data, rather than the normal output.
-
在
npm pkg set
中,它可以使用 JSON.parse() 解析集合值,然后再将它们保存到你的package.json
。¥In
npm pkg set
it enables parsing set values with JSON.parse() before saving them to yourpackage.json
.
并非所有 npm 命令都支持。
¥Not supported by all npm commands.
preid
-
默认值:""
¥Default: ""
-
类型:字符串
¥Type: String
"预发布标识符" 用作 semver 的 "prerelease" 部分的前缀。就像 1.2.0-rc.8
中的 rc
。
¥The "prerelease identifier" to use as a prefix for the "prerelease" part of a semver. Like the rc
in 1.2.0-rc.8
.
sign-git-tag
-
默认值:false
¥Default: false
-
类型:布尔值
¥Type: Boolean
如果设置为 true,则 npm version
命令将使用 -s
标记版本以添加签名。
¥If set to true, then the npm version
command will tag the version using -s
to add a signature.
请注意,git 要求你在 git 配置中设置 GPG 密钥才能正常工作。
¥Note that git requires you to have set up GPG keys in your git configs for this to work properly.
workspace
-
默认值:
¥Default:
-
类型:字符串(可以设置多次)
¥Type: String (can be set multiple times)
启用在当前项目的已配置工作区的上下文中运行命令,同时通过仅运行此配置选项定义的工作区进行过滤。