Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/html/doc/files/package.json.html')
-rw-r--r--deps/npm/html/doc/files/package.json.html39
1 files changed, 37 insertions, 2 deletions
diff --git a/deps/npm/html/doc/files/package.json.html b/deps/npm/html/doc/files/package.json.html
index 9dbb57d6d2a..bcb0a56bf8b 100644
--- a/deps/npm/html/doc/files/package.json.html
+++ b/deps/npm/html/doc/files/package.json.html
@@ -3,6 +3,7 @@
<title>package.json</title>
<meta http-equiv="content-type" value="text/html;utf-8">
<link rel="stylesheet" type="text/css" href="../../static/style.css">
+ <link rel="canonical" href="https://www.npmjs.org/doc/files/package.json.html">
<script async=true src="../../static/toc.js"></script>
<body>
@@ -310,7 +311,7 @@ a tarball or git URL.</p>
<p>See <a href="../misc/semver.html">semver(7)</a> for more details about specifying version ranges.</p>
-<ul><li><code>version</code> Must match <code>version</code> exactly</li><li><code>&gt;version</code> Must be greater than <code>version</code></li><li><code>&gt;=version</code> etc</li><li><code>&lt;version</code></li><li><code>&lt;=version</code></li><li><code>~version</code> &quot;Approximately equivalent to version&quot; See <a href="../misc/semver.html">semver(7)</a></li><li><code>1.2.x</code> 1.2.0, 1.2.1, etc., but not 1.3.0</li><li><code>http://...</code> See &#39;URLs as Dependencies&#39; below</li><li><code>*</code> Matches any version</li><li><code>&quot;&quot;</code> (just an empty string) Same as <code>*</code></li><li><code>version1 - version2</code> Same as <code>&gt;=version1 &lt;=version2</code>.</li><li><code>range1 || range2</code> Passes if either range1 or range2 are satisfied.</li><li><code>git...</code> See &#39;Git URLs as Dependencies&#39; below</li><li><code>user/repo</code> See &#39;GitHub URLs&#39; below</li></ul>
+<ul><li><code>version</code> Must match <code>version</code> exactly</li><li><code>&gt;version</code> Must be greater than <code>version</code></li><li><code>&gt;=version</code> etc</li><li><code>&lt;version</code></li><li><code>&lt;=version</code></li><li><code>~version</code> &quot;Approximately equivalent to version&quot; See <a href="../misc/semver.html">semver(7)</a></li><li><code>^version</code> &quot;Compatible with version&quot; See <a href="../misc/semver.html">semver(7)</a></li><li><code>1.2.x</code> 1.2.0, 1.2.1, etc., but not 1.3.0</li><li><code>http://...</code> See &#39;URLs as Dependencies&#39; below</li><li><code>*</code> Matches any version</li><li><code>&quot;&quot;</code> (just an empty string) Same as <code>*</code></li><li><code>version1 - version2</code> Same as <code>&gt;=version1 &lt;=version2</code>.</li><li><code>range1 || range2</code> Passes if either range1 or range2 are satisfied.</li><li><code>git...</code> See &#39;Git URLs as Dependencies&#39; below</li><li><code>user/repo</code> See &#39;GitHub URLs&#39; below</li></ul>
<p>For example, these are all valid:</p>
@@ -396,6 +397,40 @@ can consume the functionality without requiring them to compile it
themselves. In dev mode (ie, locally running <code>npm install</code>), it&#39;ll
run this script as well, so that you can test it easily.</p>
+<h2 id="peerDependencies">peerDependencies</h2>
+
+<p>In some cases, you want to express the compatibility of your package with an
+host tool or library, while not necessarily doing a <code>require</code> of this host.
+This is usually refered to as a <em>plugin</em>. Notably, your module may be exposing
+a specific interface, expected and specified by the host documentation.</p>
+
+<p>For example:</p>
+
+<pre><code>{
+ &quot;name&quot;: &quot;tea-latte&quot;,
+ &quot;version&quot;: &quot;1.3.5&quot;
+ &quot;peerDependencies&quot;: {
+ &quot;tea&quot;: &quot;2.x&quot;
+ }
+}</code></pre>
+
+<p>This ensures your package <code>tea-latte</code> can be installed <em>along</em> with the second
+major version of the host package <code>tea</code> only. The host package is automatically
+installed if needed. <code>npm install tea-latte</code> could possibly yield the following
+dependency graph:</p>
+
+<pre><code>├── tea-latte@1.3.5
+└── tea@2.2.0</code></pre>
+
+<p>Trying to install another plugin with a conflicting requirement will cause an
+error. For this reason, make sure your plugin requirement is as broad as
+possible, and not to lock it down to specific patch versions.</p>
+
+<p>Assuming the host complies with <a href="http://semver.org/">semver</a>, only changes in
+the host package&#39;s major version will break your plugin. Thus, if you&#39;ve worked
+with every 1.x version of the host package, use <code>&quot;^1.0&quot;</code> or <code>&quot;1.x&quot;</code> to express
+this. If you depend on features introduced in 1.5.2, use <code>&quot;&gt;= 1.5.2 &lt; 2&quot;</code>.</p>
+
<h2 id="bundledDependencies">bundledDependencies</h2>
<p>Array of package names that will be bundled when publishing the package.</p>
@@ -554,5 +589,5 @@ ignored.</p></li></ul>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">package.json &mdash; npm@1.4.6</p>
+<p id="footer">package.json &mdash; npm@1.4.8</p>