Index
Overview


. npm links are a handy npm tool that allows local testing when you are modifying multiple modules simultaneously.

link Commands


#Assume we are in directory with package.json with name @garypeterson/foo
> npm link
#Establishes link @garypeterson/foo to this module

#To use link, go to consumer module directory, let's say module "foo-test", and do:
> npm link @garypeterson/foo

#List all local links (to a package)
#First navigate to package folder in your CLI, then:
> npm ls --link=true

#List all links
> npm ls -global --depth=0 --link=true

#Remove a link
> npm rm --global @garypeterson/foo



unlink Commands


Note Well -- tread cautiously, seems unlink can make things worse if not done exactly per examples (e.g. with given switches).

Establish a link.
Work in order of: 1. package folder, 2. consumer folder.

#In package folder where package has module name "foo"
> npm link

#In consumer folder
> npm link foo

Unlink the previously established link.

Work in order of: 1. consumer folder, 2. package folder

Note: The unlink work (directory) order is the reverse of the link work order.

#In consumer folder
> npm unlink --no-save foo

#In package folder (where package has module name foo)
> npm unlink