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