The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / deps / npm / html / doc / version.html @ d46ebffb

History | View | Annotate | Download (2.75 KB)

1
<!doctype html>
2
<html>
3
  <title>version</title>
4
  <meta http-equiv="content-type" value="text/html;utf-8">
5
  <link rel="stylesheet" type="text/css" href="../static/style.css">
6

    
7
  <body>
8
    <div id="wrapper">
9
<h1><a href="../doc/version.html">version</a></h1> <p>Bump a package version</p>
10

    
11
<h2 id="SYNOPSIS">SYNOPSIS</h2>
12

    
13
<pre><code>npm version [&lt;newversion&gt; | major | minor | patch | build]</code></pre>
14

    
15
<h2 id="DESCRIPTION">DESCRIPTION</h2>
16

    
17
<p>Run this in a package directory to bump the version and write the new
18
data back to the package.json file.</p>
19

    
20
<p>The <code>newversion</code> argument should be a valid semver string, <em>or</em> a valid
21
second argument to semver.inc (one of &quot;build&quot;, &quot;patch&quot;, &quot;minor&quot;, or
22
&quot;major&quot;). In the second case, the existing version will be incremented
23
by 1 in the specified field.</p>
24

    
25
<p>If run in a git repo, it will also create a version commit and tag, and
26
fail if the repo is not clean.</p>
27

    
28
<p>If supplied with <code>--message</code> (shorthand: <code>-m</code>) config option, npm will
29
use it as a commit message when creating a version commit.  If the
30
<code>message</code> config contains <code>%s</code> then that will be replaced with the
31
resulting version number.  For example:</p>
32

    
33
<pre><code>npm version patch -m &quot;Upgrade to %s for reasons&quot;</code></pre>
34

    
35
<p>If the <code>sign-git-tag</code> config is set, then the tag will be signed using
36
the <code>-s</code> flag to git.  Note that you must have a default GPG key set up
37
in your git config for this to work properly.  For example:</p>
38

    
39
<pre><code>$ npm config set sign-git-tag true
40
$ npm version patch
41

    
42
You need a passphrase to unlock the secret key for
43
user: &quot;isaacs (http://blog.izs.me/) &lt;i@izs.me&gt;&quot;
44
2048-bit RSA key, ID 6C481CF6, created 2010-08-31
45

    
46
Enter passphrase:</code></pre>
47

    
48
<h2 id="SEE-ALSO">SEE ALSO</h2>
49

    
50
<ul><li><a href="../doc/init.html">init(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/semver.html">semver(1)</a></li></ul>
51
</div>
52
<p id="footer">version &mdash; npm@1.2.17</p>
53
<script>
54
;(function () {
55
var wrapper = document.getElementById("wrapper")
56
var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
57
  .filter(function (el) {
58
    return el.parentNode === wrapper
59
        && el.tagName.match(/H[1-6]/)
60
        && el.id
61
  })
62
var l = 2
63
  , toc = document.createElement("ul")
64
toc.innerHTML = els.map(function (el) {
65
  var i = el.tagName.charAt(1)
66
    , out = ""
67
  while (i > l) {
68
    out += "<ul>"
69
    l ++
70
  }
71
  while (i < l) {
72
    out += "</ul>"
73
    l --
74
  }
75
  out += "<li><a href='#" + el.id + "'>" +
76
    ( el.innerText || el.text || el.innerHTML)
77
    + "</a>"
78
  return out
79
}).join("\n")
80
toc.id = "toc"
81
document.body.appendChild(toc)
82
})()
83
</script>
84
</body></html>