3 <title>npm-submodule</title>
4 <meta http-equiv="content-type" value="text/html;utf-8">
5 <link rel="stylesheet" type="text/css" href="../../static/style.css">
9 <h1><a href="../api/npm-submodule.html">npm-submodule</a></h1> <p>Add a package as a git submodule</p>
11 <h2 id="SYNOPSIS">SYNOPSIS</h2>
13 <pre><code>npm.commands.submodule(packages, callback)</code></pre>
15 <h2 id="DESCRIPTION">DESCRIPTION</h2>
17 <p>For each package specified, npm will check if it has a git repository url
18 in its package.json description then add it as a git submodule at
19 <code>node_modules/<pkg name></code>.</p>
21 <p>This is a convenience only. From then on, it's up to you to manage
22 updates by using the appropriate git commands. npm will stubbornly
23 refuse to update, modify, or remove anything with a <code>.git</code> subfolder
26 <p>This command also does not install missing dependencies, if the package
27 does not include them in its git repository. If <code>npm ls</code> reports that
28 things are missing, you can either install, link, or submodule them yourself,
29 or you can do <code>npm explore <pkgname> -- npm install</code> to install the
30 dependencies into the submodule folder.</p>
32 <h2 id="SEE-ALSO">SEE ALSO</h2>
34 <ul><li>npm help json</li><li>git help submodule</li></ul>
36 <p id="footer">npm-submodule — npm@1.3.19</p>
39 var wrapper = document.getElementById("wrapper")
40 var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
41 .filter(function (el) {
42 return el.parentNode === wrapper
43 && el.tagName.match(/H[1-6]/)
47 , toc = document.createElement("ul")
48 toc.innerHTML = els.map(function (el) {
49 var i = el.tagName.charAt(1)
59 out += "<li><a href='#" + el.id + "'>" +
60 ( el.innerText || el.text || el.innerHTML)
65 document.body.appendChild(toc)