diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2015-04-10 14:08:32 +0300 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2015-04-10 14:08:51 +0300 |
commit | 75d426787869d54ca7400408f562f971b34649ef (patch) | |
tree | 0ef0f6364f630b8d2be91c5a71750b6b63a2f4df | |
parent | c8faf12ee4edce401e107855967fc8da0ea40120 (diff) |
doc: document new hosted git shortcut syntax
-rw-r--r-- | doc/cli/npm-install.md | 42 | ||||
-rw-r--r-- | doc/files/package.json.md | 10 |
2 files changed, 47 insertions, 5 deletions
diff --git a/doc/cli/npm-install.md b/doc/cli/npm-install.md index acc221d31..6c732c4f6 100644 --- a/doc/cli/npm-install.md +++ b/doc/cli/npm-install.md @@ -164,15 +164,51 @@ after packing it up into a tarball (b). npm install mygithubuser/myproject - To reference a package in a git repo that is not on GitHub, see git - remote urls below. + To reference a package in a generic git repo (not on GitHub), see git remote + urls below. + +* `npm install github:<githubname>/<githubrepo>`: + + The same as the above, but explicitly marked as a GitHub dependency. + + Example: + + npm install github:npm/npm + +* `npm install gist:[<githubname>/]<gistID>`: + + Install the package at `https://gist.github.com/gistID` by attempting to + clone it using `git`. The GitHub username associated with the gist is + optional and will not be saved in `package.json` if `--save` is used. + + Example: + + npm install gist:101a11beef + +* `npm install bitbucket:<bitbucketname>/<bitbucketrepo>`: + + Install the package at `https://bitbucket.org/bitbucketname/bitbucketrepo` + by attempting to clone it using `git`. + + Example: + + npm install bitbucket:mybitbucketuser/myproject + +* `npm install gitlab:<gitlabname>/<gitlabrepo>`: + + Install the package at `https://gitlab.com/gitlabname/gitlabrepo` + by attempting to clone it using `git`. + + Example: + + npm install gitlab:mygitlabuser/myproject * `npm install <git remote url>`: Install a package by cloning a git remote url. The format of the git url is: - <protocol>://[<user>@]<hostname><separator><path>[#<commit-ish>] + <protocol>://[<user>[:<password>]@]<hostname><separator><path>[#<commit-ish>] `<protocol>` is one of `git`, `git+ssh`, `git+http`, or `git+https`. If no `<commit-ish>` is specified, then `master` is diff --git a/doc/files/package.json.md b/doc/files/package.json.md index 18a398b77..b1c8f210f 100644 --- a/doc/files/package.json.md +++ b/doc/files/package.json.md @@ -272,11 +272,17 @@ The URL should be a publicly available (perhaps read-only) url that can be hande directly to a VCS program without any modification. It should not be a url to an html project page that you put in your browser. It's for computers. -For GitHub repositories you can use the same shortcut syntax you use for `npm -install`: +For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same +shortcut syntax you use for `npm install`: "repository": "npm/npm" + "repository": "gist:11081aaa281" + + "repository": "bitbucket:example/repo" + + "repository": "gitlab:another/repo" + ## scripts The "scripts" property is a dictionary containing script commands that are run |