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 / cli / npm-dedupe.html @ 5e865191

History | View | Annotate | Download (2.63 KB)

1
<!doctype html>
2
<html>
3
  <title>npm-dedupe</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="../cli/npm-dedupe.html">npm-dedupe</a></h1> <p>Reduce duplication</p>
10

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

    
13
<pre><code>npm dedupe [package names...]</code></pre>
14

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

    
17
<p>Searches the local package tree and attempts to simplify the overall
18
structure by moving dependencies further up the tree, where they can
19
be more effectively shared by multiple dependent packages.</p>
20

    
21
<p>For example, consider this dependency graph:</p>
22

    
23
<pre><code>a
24
+-- b &lt;-- depends on c@1.0.x
25
|   `-- c@1.0.3
26
`-- d &lt;-- depends on c@~1.0.9
27
    `-- c@1.0.10</code></pre>
28

    
29
<p>In this case, <code><a href="../cli/npm-dedupe.html">npm-dedupe(1)</a></code> will transform the tree to:</p>
30

    
31
<pre><code>a
32
+-- b
33
+-- d
34
`-- c@1.0.10</code></pre>
35

    
36
<p>Because of the hierarchical nature of node&#39;s module lookup, b and d
37
will both get their dependency met by the single c package at the root
38
level of the tree.</p>
39

    
40
<p>If a suitable version exists at the target location in the tree
41
already, then it will be left untouched, but the other duplicates will
42
be deleted.</p>
43

    
44
<p>If no suitable version can be found, then a warning is printed, and
45
nothing is done.</p>
46

    
47
<p>If any arguments are supplied, then they are filters, and only the
48
named packages will be touched.</p>
49

    
50
<p>Note that this operation transforms the dependency tree, and may
51
result in packages getting updated versions, perhaps from the npm
52
registry.</p>
53

    
54
<p>This feature is experimental, and may change in future versions.</p>
55

    
56
<h2 id="SEE-ALSO">SEE ALSO</h2>
57

    
58
<ul><li><a href="../cli/npm-ls.html">npm-ls(1)</a></li><li><a href="../cli/npm-update.html">npm-update(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li></ul>
59
</div>
60
<p id="footer">npm-dedupe &mdash; npm@1.3.4</p>
61
<script>
62
;(function () {
63
var wrapper = document.getElementById("wrapper")
64
var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
65
  .filter(function (el) {
66
    return el.parentNode === wrapper
67
        && el.tagName.match(/H[1-6]/)
68
        && el.id
69
  })
70
var l = 2
71
  , toc = document.createElement("ul")
72
toc.innerHTML = els.map(function (el) {
73
  var i = el.tagName.charAt(1)
74
    , out = ""
75
  while (i > l) {
76
    out += "<ul>"
77
    l ++
78
  }
79
  while (i < l) {
80
    out += "</ul>"
81
    l --
82
  }
83
  out += "<li><a href='#" + el.id + "'>" +
84
    ( el.innerText || el.text || el.innerHTML)
85
    + "</a>"
86
  return out
87
}).join("\n")
88
toc.id = "toc"
89
document.body.appendChild(toc)
90
})()
91
</script>