mirror of https://github.com/nodejs/node.git
13 lines
679 B
HTML
13 lines
679 B
HTML
<h1><a href="../api/npm-version.html">npm-version</a></h1> <p>Bump a package version</p>
|
|
<h2 id="synopsis">SYNOPSIS</h2>
|
|
<pre><code>npm.commands.version(newversion, callback)
|
|
</code></pre><h2 id="description">DESCRIPTION</h2>
|
|
<p>Run this in a package directory to bump the version and write the new
|
|
data back to the package.json file.</p>
|
|
<p>If run in a git repo, it will also create a version commit and tag, and
|
|
fail if the repo is not clean.</p>
|
|
<p>Like all other commands, this function takes a string array as its first
|
|
parameter. The difference, however, is this function will fail if it does
|
|
not have exactly one element. The only element should be a version number.</p>
|
|
|