3 <title>npm-edit</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-edit.html">npm-edit</a></h1> <p>Edit an installed package</p>
11 <h2 id="SYNOPSIS">SYNOPSIS</h2>
13 <pre><code>npm.commands.edit(package, callback)</code></pre>
15 <h2 id="DESCRIPTION">DESCRIPTION</h2>
17 <p>Opens the package folder in the default editor (or whatever you've
18 configured as the npm <code>editor</code> config -- see <code>npm help config</code>.)</p>
20 <p>After it has been edited, the package is rebuilt so as to pick up any
21 changes in compiled packages.</p>
23 <p>For instance, you can do <code>npm install connect</code> to install connect
24 into your package, and then <code>npm.commands.edit(["connect"], callback)</code>
25 to make a few changes to your locally installed copy.</p>
27 <p>The first parameter is a string array with a single element, the package
28 to open. The package can optionally have a version number attached.</p>
30 <p>Since this command opens an editor in a new process, be careful about where
31 and how this is used.</p>
33 <p id="footer">npm-edit — npm@1.3.19</p>
36 var wrapper = document.getElementById("wrapper")
37 var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
38 .filter(function (el) {
39 return el.parentNode === wrapper
40 && el.tagName.match(/H[1-6]/)
44 , toc = document.createElement("ul")
45 toc.innerHTML = els.map(function (el) {
46 var i = el.tagName.charAt(1)
56 out += "<li><a href='#" + el.id + "'>" +
57 ( el.innerText || el.text || el.innerHTML)
62 document.body.appendChild(toc)