github-url-analyzer
v0.1.1
Published
analyze srting to github urls
Downloads
5
Maintainers
Readme
github-url-analyzer
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://[email protected]/project/blah.git#commit-ish',
// 'git+https://[email protected]/project/blah.git#commit-ish',
// '[email protected]:user/project.git',
// '[email protected]: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: '[email protected]:lisposter/github-url-analyzer.git',
// git: 'git://github.com/lisposter/github-url-analyzer.git'
// }
License
MIT © Leigh Zhu