]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/README.md
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / normalize-git-url / README.md
1 # normalize-git-url
2
3 You have a bunch of Git URLs. You want to convert them to a canonical
4 representation, probably for use inside npm so that it doesn't end up creating
5 a bunch of superfluous cached origins. You use this package.
6
7 ## Usage
8
9 ```javascript
10 var ngu = require('normalize-git-url');
11 var normalized = ngu("git+ssh://git@github.com:organization/repo.git#hashbrowns")
12 // get back:
13 // {
14 //   url : "ssh://git@github.com/organization/repo.git",
15 //   branch : "hashbrowns" // did u know hashbrowns are delicious?
16 // }
17 ```
18
19 ## API
20
21 There's just the one function, and all it takes is a single parameter, a non-normalized Git URL.
22
23 ### normalizeGitUrl(url)
24
25 * `url` {String} The Git URL (very loosely speaking) to be normalized.
26
27 Returns an object with the following format:
28
29 * `url` {String} The normalized URL.
30 * `branch` {String} The treeish to be checked out once the repo at `url` is
31   cloned. It doesn't have to be a branch, but it's a lot easier to intuit what
32   the output is for with that name.
33
34 ## Limitations
35
36 Right now this doesn't try to special-case GitHub too much -- it doesn't ensure
37 that `.git` is added to the end of URLs, it doesn't prefer `https:` over
38 `http:` or `ssh:`, it doesn't deal with redirects, and it doesn't try to
39 resolve symbolic names to treeish hashcodes. For now, it just tries to account
40 for minor differences in representation.