repo-utils
Utils for normalizing and formatting repo data.
Install with npm
npm i repo-utils --save
Usage
var repo = require('repo-utils');
API
Create a github .git
url.
path
{String}: user/repo or org/reporeturns
{String}: Formatted github git url
repo.git('abc/xyz');
var url = require('url');
var parts = url.parse('abc/xyz');
repo.git(parts);
Create a GitHub url.
url
{String}: user/repo or org/reporeturns
{String}: Formatted github url
repo.github('abc/xyz');
repo.github('abc', 'xyz');
repo.github('abc');
repo.github('abc', {hostname: 'foo.org'});
Base method used by other utils for creating a URL from a string or object.
pathname
{String|Object}: Pathname or options object. Pathname should be user/repo or org/repooptions
{Object}returns
{String}: Formatted github url
repo.url('abc/xyz');
repo.url({pathname: 'abc/xyz'});
Run tests
Install dev dependencies:
node i -d && mocha
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 on January 10, 2015.