Generate a GitHub URL from an object.
npm
Install withnpm i stringify-github-url --save
Usage
var github = ;
github
Stringify a GitHub project URL.
user
{String}: Github user or org.repo
{String}: Project namebranch
{String}: Optionally specify a branch.returns
: {String}
Example
;//=> 'https://github.com/assemble/verb' ;//=> 'https://github.com/assemble/verb/tree/v0.6.0'
.tarball
Stringify a github tarball URL.
user
{String}: The github user or org.repo
{String}: The repositorybranch
{String}: Branch, defaults tomaster
.returns
: {String}
Example
github;//=> 'https://api.github.com/repos/assemble/verb/tarball'
.zipball
Stringify a github zipball URL.
user
{String}: The github user or org.repo
{String}: The repositorybranch
{String}: Branch, defaults tomaster
.returns
: {String}
Example
github;//=> 'https://api.github.com/repos/assemble/verb/zipball'
Related projects
- is-git-url: Regex to validate that a URL is a git url.
- parse-github-url: Parse a github URL into an object.
Running tests
Install dev dependencies.
npm i -d && npm test
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Author
Jon Schlinkert
License
Copyright (c) 2015 Jon Schlinkert
Released under the MIT license
This file was generated by verb-cli on March 14, 2015.