Discern information about git and GitHub urls
MIT License
Discern information about git and github urls.
$ npm install discern
For a folder that represents a github url, this will attempt to return the "origin" remote. On failure, the callback of the async version returns an error. In case of the synchronous version it will throw an Exception.
Takes a github url with the optional extension of using #branch-name
on the end to denote a branch/tag/commit. It returns an array containing [user, repo, branch]
where branch
defaults to master
. This can be used to build the GitHub url, a url to the tarball etc. etc.
Currently just a pass through, but the aim will be to get git urls as close as possible to some normal form. In particular, it should do the work required by npm's addRemoteGit
Returns true
if the url has a protocol of 'git:', 'git+http:', 'git+https:', 'git+rsync:', 'git+ftp:', 'git+ssh:' or path ending in '.git'.
Returns false
otherwise.
Returns true
if the url is a gist.github.com
url, otherwise false
.
Returns true
if the url is a github.com
url, otherwise false
.
MIT