Overview
npm is short for “Node Package Manager”.
This page documents selected features of npm and is far from comprehensive.
Linking
npm supports testing local changes to a package that has been published to npm. For example, suppose you are developing an application that uses the package “foo”. To test changes to the code in that package from your application:
- Clone the foo Git repository, creating a local repository.
- Make changes in the local repository.
- Enter
npm build. cdto the root directory of the foo local repository.- Enter
npm link. cdto the directory of your app.- Enter
npm link foo. - Test your application.
- Continue making changes in the foo local repository,
entering
npm buildafter each set of changes, and retesting your app.
When finished testing:
- If appropriate, create a pull request to the foo repository containing your changes.
cdto the root directory of the foo local repository.- Enter
npm unlink. cdto the directory of your app.- Enter
npm unlink foo.