ea0c5b4b09a9789733023faa8b2ef97b592af195
[platform/upstream/nodejs.git] / deps / npm / man / man1 / npm-link.1
1 .\" Generated with Ronnjs 0.3.8
2 .\" http://github.com/kapouer/ronnjs/
3 .
4 .TH "NPM\-LINK" "1" "November 2013" "" ""
5 .
6 .SH "NAME"
7 \fBnpm-link\fR \-\- Symlink a package folder
8 .
9 .SH "SYNOPSIS"
10 .
11 .nf
12 npm link (in package folder)
13 npm link <pkgname>
14 npm ln (with any of the previous argument usage)
15 .
16 .fi
17 .
18 .SH "DESCRIPTION"
19 Package linking is a two\-step process\.
20 .
21 .P
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\.
24 .
25 .P
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\.
28 .
29 .P
30 Note that \fBpackage\-name\fR is taken from \fBpackage\.json\fR,
31 not from directory name\.
32 .
33 .P
34 When creating tarballs for \fBnpm publish\fR, the linked packages are
35 "snapshotted" to their current state by resolving the symbolic links\.
36 .
37 .P
38 This is
39 handy for installing your own stuff, so that you can work on it and test it
40 iteratively without having to continually rebuild\.
41 .
42 .P
43 For example:
44 .
45 .IP "" 4
46 .
47 .nf
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
52 .
53 .fi
54 .
55 .IP "" 0
56 .
57 .P
58 Now, any changes to ~/projects/node\-redis will be reflected in
59 ~/projects/node\-bloggy/node_modules/redis/
60 .
61 .P
62 You may also shortcut the two steps in one\.  For example, to do the
63 above use\-case in a shorter way:
64 .
65 .IP "" 4
66 .
67 .nf
68 cd ~/projects/node\-bloggy  # go into the dir of your main project
69 npm link \.\./node\-redis     # link the dir of your dependency
70 .
71 .fi
72 .
73 .IP "" 0
74 .
75 .P
76 The second line is the equivalent of doing:
77 .
78 .IP "" 4
79 .
80 .nf
81 (cd \.\./node\-redis; npm link)
82 npm link redis
83 .
84 .fi
85 .
86 .IP "" 0
87 .
88 .P
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\.
91 .
92 .SH "SEE ALSO"
93 .
94 .IP "\(bu" 4
95 npm help  developers
96 .
97 .IP "\(bu" 4
98 npm help  faq
99 .
100 .IP "\(bu" 4
101 npm help  package\.json
102 .
103 .IP "\(bu" 4
104 npm help install
105 .
106 .IP "\(bu" 4
107 npm help  folders
108 .
109 .IP "\(bu" 4
110 npm help config
111 .
112 .IP "\(bu" 4
113 npm help  config
114 .
115 .IP "\(bu" 4
116 npm help  npmrc
117 .
118 .IP "" 0
119