summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/hosted-git-info/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/hosted-git-info/README.md')
-rw-r--r--deps/npm/node_modules/hosted-git-info/README.md61
1 files changed, 47 insertions, 14 deletions
diff --git a/deps/npm/node_modules/hosted-git-info/README.md b/deps/npm/node_modules/hosted-git-info/README.md
index 1db47dd656..f9db5dd959 100644
--- a/deps/npm/node_modules/hosted-git-info/README.md
+++ b/deps/npm/node_modules/hosted-git-info/README.md
@@ -4,11 +4,11 @@ This will let you identify and transform various git hosts URLs between
protocols. It also can tell you what the URL is for the raw path for
particular file for direct access without git.
-## Usage
+## Example
```javascript
var hostedGitInfo = require("hosted-git-info")
-var info = hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git")
+var info = hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git", opts)
/* info looks like:
{
type: "github",
@@ -32,9 +32,39 @@ If it does match, the returned object has properties of:
* info.user -- The name of the user/org on the git host
* info.project -- The name of the project on the git host
-And methods of:
+## Version Contract
+
+The major version will be bumped any time…
+
+* The constructor stops accepting URLs that it previously accepted.
+* A method is removed.
+* A method can no longer accept the number and type of arguments it previously accepted.
+* A method can return a different type than it currently returns.
+
+Implications:
+
+* I do not consider the specific format of the urls returned from, say
+ `.https()` to be a part of the contract. The contract is that it will
+ return a string that can be used to fetch the repo via HTTPS. But what
+ that string looks like, specifically, can change.
+* Dropping support for a hosted git provider would constitute a breaking
+ change.
+
+## Usage
+
+### var info = hostedGitInfo.fromUrl(gitSpecifier[, options])
+
+* *gitSpecifer* is a URL of a git repository or a SCP-style specifier of one.
+* *options* is an optional object. It can have the following properties:
+ * *noCommittish* — If true then committishes won't be included in generated URLs.
+ * *noGitPlus* — If true then `git+` won't be prefixed on URLs.
+
+## Methods
+
+All of the methods take the same options as the `fromUrl` factory. Options
+provided to a method override those provided to the constructor.
-* info.file(path)
+* info.file(path, opts)
Given the path of a file relative to the repository, returns a URL for
directly fetching it from the githost. If no committish was set then
@@ -43,44 +73,48 @@ directly fetching it from the githost. If no committish was set then
For example `hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git#v1.0.0").file("package.json")`
would return `https://raw.githubusercontent.com/npm/hosted-git-info/v1.0.0/package.json`
-* info.shortcut()
+* info.shortcut(opts)
eg, `github:npm/hosted-git-info`
-* info.browse()
+* info.browse(opts)
eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0`
-* info.bugs()
+* info.bugs(opts)
eg, `https://github.com/npm/hosted-git-info/issues`
-* info.docs()
+* info.docs(opts)
eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0#readme`
-* info.https()
+* info.https(opts)
eg, `git+https://github.com/npm/hosted-git-info.git`
-* info.sshurl()
+* info.sshurl(opts)
eg, `git+ssh://git@github.com/npm/hosted-git-info.git`
-* info.ssh()
+* info.ssh(opts)
eg, `git@github.com:npm/hosted-git-info.git`
-* info.path()
+* info.path(opts)
eg, `npm/hosted-git-info`
+* info.tarball(opts)
+
+eg, `https://github.com/npm/hosted-git-info/archive/v1.2.0.tar.gz`
+
* info.getDefaultRepresentation()
Returns the default output type. The default output type is based on the
string you passed in to be parsed
-* info.toString()
+* info.toString(opts)
Uses the getDefaultRepresentation to call one of the other methods to get a URL for
this resource. As such `hostedGitInfo.fromUrl(url).toString()` will give
@@ -91,7 +125,6 @@ form of `org/project` will be normalized to `github:org/project`.
SSH connect strings will be normalized into `git+ssh` URLs.
-
## Supported hosts
Currently this supports Github, Bitbucket and Gitlab. Pull requests for