The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / deps / npm / man / man1 / link.1 @ 5aef65a9

History | View | Annotate | Download (2.01 KB)

1
.\" Generated with Ronnjs 0.3.8
2
.\" http://github.com/kapouer/ronnjs/
3
.
4
.TH "NPM\-LINK" "1" "February 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
.
15
.fi
16
.
17
.SH "DESCRIPTION"
18
Package linking is a two\-step process\.
19
.
20
.P
21
First, \fBnpm link\fR in a package folder will create a globally\-installed
22
symbolic link from \fBprefix/package\-name\fR to the current folder\.
23
.
24
.P
25
Next, in some other location, \fBnpm link package\-name\fR will create a
26
symlink from the local \fBnode_modules\fR folder to the global symlink\.
27
.
28
.P
29
When creating tarballs for \fBnpm publish\fR, the linked packages are
30
"snapshotted" to their current state by resolving the symbolic links\.
31
.
32
.P
33
This is
34
handy for installing your own stuff, so that you can work on it and test it
35
iteratively without having to continually rebuild\.
36
.
37
.P
38
For example:
39
.
40
.IP "" 4
41
.
42
.nf
43
cd ~/projects/node\-redis    # go into the package directory
44
npm link                    # creates global link
45
cd ~/projects/node\-bloggy   # go into some other package directory\.
46
npm link redis              # link\-install the package
47
.
48
.fi
49
.
50
.IP "" 0
51
.
52
.P
53
Now, any changes to ~/projects/node\-redis will be reflected in
54
~/projects/node\-bloggy/node_modules/redis/
55
.
56
.P
57
You may also shortcut the two steps in one\.  For example, to do the
58
above use\-case in a shorter way:
59
.
60
.IP "" 4
61
.
62
.nf
63
cd ~/projects/node\-bloggy  # go into the dir of your main project
64
npm link \.\./node\-redis     # link the dir of your dependency
65
.
66
.fi
67
.
68
.IP "" 0
69
.
70
.P
71
The second line is the equivalent of doing:
72
.
73
.IP "" 4
74
.
75
.nf
76
(cd \.\./node\-redis; npm link)
77
npm link redis
78
.
79
.fi
80
.
81
.IP "" 0
82
.
83
.P
84
That is, it first creates a global link, and then links the global
85
installation target into your project\'s \fBnode_modules\fR folder\.
86
.
87
.SH "SEE ALSO"
88
.
89
.IP "\(bu" 4
90
npm help developers
91
.
92
.IP "\(bu" 4
93
npm help faq
94
.
95
.IP "\(bu" 4
96
npm help json
97
.
98
.IP "\(bu" 4
99
npm help install
100
.
101
.IP "\(bu" 4
102
npm help folders
103
.
104
.IP "\(bu" 4
105
npm help config
106
.
107
.IP "" 0
108