1 .\" Generated with Ronnjs 0.3.8
2 .\" http://github.com/kapouer/ronnjs/
4 .TH "NPM\-LINK" "1" "December 2013" "" ""
7 \fBnpm-link\fR \-\- Symlink a package folder
12 npm link (in package folder)
14 npm ln (with any of the previous argument usage)
19 Package linking is a two\-step process\.
22 First, \fBnpm link\fR in a package folder will create a globally\-installed
23 symbolic link from \fBprefix/package\-name\fR to the current folder\.
26 Next, in some other location, \fBnpm link package\-name\fR will create a
27 symlink from the local \fBnode_modules\fR folder to the global symlink\.
30 Note that \fBpackage\-name\fR is taken from \fBpackage\.json\fR,
31 not from directory name\.
34 When creating tarballs for \fBnpm publish\fR, the linked packages are
35 "snapshotted" to their current state by resolving the symbolic links\.
39 handy for installing your own stuff, so that you can work on it and test it
40 iteratively without having to continually rebuild\.
48 cd ~/projects/node\-redis # go into the package directory
49 npm link # creates global link
50 cd ~/projects/node\-bloggy # go into some other package directory\.
51 npm link redis # link\-install the package
58 Now, any changes to ~/projects/node\-redis will be reflected in
59 ~/projects/node\-bloggy/node_modules/redis/
62 You may also shortcut the two steps in one\. For example, to do the
63 above use\-case in a shorter way:
68 cd ~/projects/node\-bloggy # go into the dir of your main project
69 npm link \.\./node\-redis # link the dir of your dependency
76 The second line is the equivalent of doing:
81 (cd \.\./node\-redis; npm link)
89 That is, it first creates a global link, and then links the global
90 installation target into your project\'s \fBnode_modules\fR folder\.
101 npm help package\.json