blob: 94f573173900da2a5de5594d11e3a3b5723f417b [file] [log] [blame]
<!doctype html>
<html>
<title>npm-link</title>
<meta http-equiv="content-type" value="text/html;utf-8">
<link rel="stylesheet" type="text/css" href="../../static/style.css">
<body>
<div id="wrapper">
<h1><a href="../api/npm-link.html">npm-link</a></h1> <p>Symlink a package folder</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<pre><code>npm.command.link(callback)
npm.command.link(packages, callback)</code></pre>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p>Package linking is a two-step process.</p>
<p>Without parameters, link will create a globally-installed
symbolic link from <code>prefix/package-name</code> to the current folder.</p>
<p>With a parameters, link will create a symlink from the local <code>node_modules</code>
folder to the global symlink.</p>
<p>When creating tarballs for <code>npm publish</code>, the linked packages are
&quot;snapshotted&quot; to their current state by resolving the symbolic links.</p>
<p>This is
handy for installing your own stuff, so that you can work on it and test it
iteratively without having to continually rebuild.</p>
<p>For example:</p>
<pre><code>npm.commands.link(cb) # creates global link from the cwd
# (say redis package)
npm.commands.link(&#39;redis&#39;, cb) # link-install the package</code></pre>
<p>Now, any changes to the redis package will be reflected in
the package in the current working directory</p>
</div>
<p id="footer">npm-link &mdash; npm@1.3.21</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
.filter(function (el) {
return el.parentNode === wrapper
&& el.tagName.match(/H[1-6]/)
&& el.id
})
var l = 2
, toc = document.createElement("ul")
toc.innerHTML = els.map(function (el) {
var i = el.tagName.charAt(1)
, out = ""
while (i > l) {
out += "<ul>"
l ++
}
while (i < l) {
out += "</ul>"
l --
}
out += "<li><a href='#" + el.id + "'>" +
( el.innerText || el.text || el.innerHTML)
+ "</a>"
return out
}).join("\n")
toc.id = "toc"
document.body.appendChild(toc)
})()
</script>