Skip to content

lisposter/github-url-analyzer

Repository files navigation

github-url-analyzer

NPM version

analyze srting to normal github project urls

Installation

$ npm install github-url-analyzer

Usage

var analyzer = require('github-url-analyzer');

console.log(analyzer(str));

// str can be one of these:

// 'user/project',
// 'git://github.com/user/project#commit-ish',
// 'git://github.com/user/project.git#commit-ish',
// 'https://github.com/user/project#commit-ish',
// 'https://github.com/user/project.git',
// 'git+ssh://github.com/user/project.git',
// 'git+http://user@github.com/project/blah.git#commit-ish',
// 'git+https://user@github.com/project/blah.git#commit-ish',
// 'git@github.com:user/project.git',
// 'git@github.com:user/project.git#commit-ish'
// 'https://github.com/user/project/archive/v0.2.2.zip',
// 'https://github.com/user/project/archive/v0.2.2.tar.gz'

eg.

var analyzer = require('github-url-analyzer');

console.log(analyzer('lisposter/github-url-analyzer'));

// { 
//     repo: 'https://github.com/lisposter/github-url-analyzer',
//     https: 'https://github.com/lisposter/github-url-analyzer.git',
//     ssh: 'git@github.com:lisposter/github-url-analyzer.git',
//     git: 'git://github.com/lisposter/github-url-analyzer.git' 
// }

License

MIT © Leigh Zhu

About

turn string into repo url, https, ssh, git format url (for github)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published