Skip to content

Commit

Permalink
add git URL format to json + developers docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alunny authored and isaacs committed Feb 29, 2012
1 parent 2f51f30 commit 3abab66
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions doc/cli/developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,23 @@ A package is:
* d) a `<name>@<version>` that is published on the registry with (c)
* e) a `<name>@<tag>` that points to (d)
* f) a `<name>` that has a "latest" tag satisfying (e)
* g) a `git` url that, when cloned, results in (a).

Even if you never publish your package, you can still get a lot of
benefits of using npm if you just want to write a node program (a), and
perhaps if you also want to be able to easily install it elsewhere
after packing it up into a tarball (b).

Git urls can be of the form:

git://github.com/user/project.git#commit-ish
git+ssh://user@hostname:project.git#commit-ish
git+http://user@hostname/project/blah.git#commit-ish
git+https://user@hostname/project/blah.git#commit-ish

The `commit-ish` can be any tag, sha, or branch which can be supplied as
an argument to `git checkout`. The default is `master`.

## The package.json File

You need to have a `package.json` file in the root of your project to do
Expand Down
13 changes: 13 additions & 0 deletions doc/cli/json.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ is a semver compatible version identifier.
* `""` (just an empty string) Same as `*`
* `version1 - version2` Same as `>=version1 <=version2`.
* `range1 || range2` Passes if either range1 or range2 are satisfied.
* `git...` See 'Git URLs as Dependencies' below

For example, these are all valid:

Expand Down Expand Up @@ -387,6 +388,18 @@ of a version range.
This tarball will be downloaded and installed locally to your package at
install time.

### Git URLs as Dependencies

Git urls can be of the form:

git://github.com/user/project.git#commit-ish
git+ssh://user@hostname:project.git#commit-ish
git+http://user@hostname/project/blah.git#commit-ish
git+https://user@hostname/project/blah.git#commit-ish

The `commit-ish` can be any tag, sha, or branch which can be supplied as
an argument to `git checkout`. The default is `master`.

## devDependencies

If someone is planning on downloading and using your module in their
Expand Down

0 comments on commit 3abab66

Please sign in to comment.