gh-repo-to-user
v1.1.0
Published
Get GitHub username from a repo, accepting repos like package.json\'s repository field
Downloads
3
Readme
gh-repo-to-user
Get GitHub username from a repo, accepting repos like package.json's repository field
Installation
Install gh-repo-to-user
using npm:
npm install --save gh-repo-to-user
Usage
Module usage
var ghRepoToUser = require('gh-repo-to-user');
ghRepoToUser('joakimbeng/repo');
// "joakimbeng"
ghRepoToUser({type: 'git', url: 'https://github.com/joakimbeng/repo.git'});
// "joakimbeng"
API
ghRepoToUser(repo)
| Name | Type | Description |
|------|------|-------------|
| repo | String|Object
| The repository to get GitHub username from |
Returns: String
or NULL
if not found.
License
MIT © Joakim Carlstein