0.1.1 • Published 10 years ago

github-url-analyzer v0.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

github-url-analyzer

NPM version

analyze srting to github 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