]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-link.1
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / man / man1 / npm-link.1
1 .TH "NPM\-LINK" "1" "October 2016" "" ""
2 .SH "NAME"
3 \fBnpm-link\fR \- Symlink a package folder
4 .SH SYNOPSIS
5 .P
6 .RS 2
7 .nf
8 npm link (in package folder)
9 npm link [@<scope>/]<pkgname>
10 npm ln (with any of the previous argument usage)
11 .fi
12 .RE
13 .SH DESCRIPTION
14 .P
15 Package linking is a two\-step process\.
16 .P
17 First, \fBnpm link\fP in a package folder will create a symlink in the global folder
18 \fB{prefix}/lib/node_modules/<package>\fP that links to the package where the \fBnpm
19 link\fP command was executed\. (see npm help 7 \fBnpm\-config\fP for the value of \fBprefix\fP)\. It
20 will also link any bins in the package to \fB{prefix}/bin/{name}\fP\|\.
21 .P
22 Next, in some other location, \fBnpm link package\-name\fP will create a
23 symbolic link from globally\-installed \fBpackage\-name\fP to \fBnode_modules/\fP
24 of the current folder\.
25 .P
26 Note that \fBpackage\-name\fP is taken from \fBpackage\.json\fP,
27 not from directory name\.
28 .P
29 The package name can be optionally prefixed with a scope\. See npm help 7 \fBnpm\-scope\fP\|\.
30 The scope must be preceded by an @\-symbol and followed by a slash\.
31 .P
32 When creating tarballs for \fBnpm publish\fP, the linked packages are
33 "snapshotted" to their current state by resolving the symbolic links\.
34 .P
35 This is handy for installing your own stuff, so that you can work on it and
36 test it iteratively without having to continually rebuild\.
37 .P
38 For example:
39 .P
40 .RS 2
41 .nf
42 cd ~/projects/node\-redis    # go into the package directory
43 npm link                    # creates global link
44 cd ~/projects/node\-bloggy   # go into some other package directory\.
45 npm link redis              # link\-install the package
46 .fi
47 .RE
48 .P
49 Now, any changes to ~/projects/node\-redis will be reflected in
50 ~/projects/node\-bloggy/node_modules/node\-redis/\. Note that the link should
51 be to the package name, not the directory name for that package\.
52 .P
53 You may also shortcut the two steps in one\.  For example, to do the
54 above use\-case in a shorter way:
55 .P
56 .RS 2
57 .nf
58 cd ~/projects/node\-bloggy  # go into the dir of your main project
59 npm link \.\./node\-redis     # link the dir of your dependency
60 .fi
61 .RE
62 .P
63 The second line is the equivalent of doing:
64 .P
65 .RS 2
66 .nf
67 (cd \.\./node\-redis; npm link)
68 npm link node\-redis
69 .fi
70 .RE
71 .P
72 That is, it first creates a global link, and then links the global
73 installation target into your project's \fBnode_modules\fP folder\.
74 .P
75 If your linked package is scoped (see npm help 7 \fBnpm\-scope\fP) your link command must
76 include that scope, e\.g\.
77 .P
78 .RS 2
79 .nf
80 npm link @myorg/privatepackage
81 .fi
82 .RE
83 .SH SEE ALSO
84 .RS 0
85 .IP \(bu 2
86 npm help 7 developers
87 .IP \(bu 2
88 npm help 7 faq
89 .IP \(bu 2
90 npm help 5 package\.json
91 .IP \(bu 2
92 npm help install
93 .IP \(bu 2
94 npm help 5 folders
95 .IP \(bu 2
96 npm help config
97 .IP \(bu 2
98 npm help 7 config
99 .IP \(bu 2
100 npm help 5 npmrc
101
102 .RE
103