2014-09-17 06:38:50 +08:00
|
|
|
.TH "NPM\-LINK" "3" "September 2014" "" ""
|
2011-11-27 01:21:03 +08:00
|
|
|
.SH "NAME"
|
2014-09-25 05:41:07 +08:00
|
|
|
\fBnpm-link\fR \- Symlink a package folder
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.P
|
|
|
|
.RS 2
|
|
|
|
.EX
|
2014-08-01 00:05:30 +08:00
|
|
|
npm\.commands\.link(callback)
|
|
|
|
npm\.commands\.link(packages, callback)
|
2014-09-25 05:41:07 +08:00
|
|
|
.EE
|
|
|
|
.RE
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.P
|
2011-11-27 01:21:03 +08:00
|
|
|
Package linking is a two\-step process\.
|
|
|
|
.P
|
|
|
|
Without parameters, link will create a globally\-installed
|
|
|
|
symbolic link from \fBprefix/package\-name\fR to the current folder\.
|
|
|
|
.P
|
|
|
|
With a parameters, link will create a symlink from the local \fBnode_modules\fR
|
|
|
|
folder to the global symlink\.
|
|
|
|
.P
|
|
|
|
When creating tarballs for \fBnpm publish\fR, the linked packages are
|
|
|
|
"snapshotted" to their current state by resolving the symbolic links\.
|
|
|
|
.P
|
|
|
|
This is
|
|
|
|
handy for installing your own stuff, so that you can work on it and test it
|
|
|
|
iteratively without having to continually rebuild\.
|
|
|
|
.P
|
|
|
|
For example:
|
2014-09-25 05:41:07 +08:00
|
|
|
.P
|
|
|
|
.RS 2
|
|
|
|
.EX
|
2011-11-27 01:21:03 +08:00
|
|
|
npm\.commands\.link(cb) # creates global link from the cwd
|
|
|
|
# (say redis package)
|
2014-09-25 05:41:07 +08:00
|
|
|
npm\.commands\.link('redis', cb) # link\-install the package
|
|
|
|
.EE
|
|
|
|
.RE
|
2011-11-27 01:21:03 +08:00
|
|
|
.P
|
|
|
|
Now, any changes to the redis package will be reflected in
|
|
|
|
the package in the current working directory
|
2014-09-25 05:41:07 +08:00
|
|
|
|