diff --git a/docs/content/cli-commands/npm-install.md b/docs/content/cli-commands/npm-install.md index cfb96aeedd939..368866c571a60 100644 --- a/docs/content/cli-commands/npm-install.md +++ b/docs/content/cli-commands/npm-install.md @@ -16,6 +16,7 @@ npm install [<@scope>/] npm install [<@scope>/]@ npm install [<@scope>/]@ npm install [<@scope>/]@ +npm install @npm: npm install :/ npm install npm install @@ -113,6 +114,19 @@ after packing it up into a tarball (b). npm install sax +* `npm install @npm:`: + + Install a package under a custom alias. Allows multiple versions of a same-name package side-by-side, more convenient import names for packages with otherwise long ones and using git forks replacements or forked npm packages as replacements. Aliasing works only on your project and does + not rename packages in transitive dependencies. Aliases should follow + the naming conventions stated in [`validate-npm-package-name`](https://www.npmjs.com/package/validate-npm-package-name#naming-rules). + + Examples: + + npm install my-react@npm:react + npm install jquery2@npm:jquery@2 + npm install jquery3@npm:jquery@3 + npm install npa@npm:npm-package-arg + `npm install` saves any specified packages into `dependencies` by default. Additionally, you can control where and how they get saved with some additional flags: diff --git a/lib/install.js b/lib/install.js index a4cf2b186de51..528a3a0b59a75 100644 --- a/lib/install.js +++ b/lib/install.js @@ -26,6 +26,7 @@ install.usage = usage( '\nnpm install [<@scope>/]@' + '\nnpm install [<@scope>/]@' + '\nnpm install [<@scope>/]@' + + '\nnpm install @npm:' + '\nnpm install ' + '\nnpm install ' + '\nnpm install ' +