Parse a GitHub URL for user/project@version
$ cnpm install @bahmutov/parse-github-repo-url
Parse a GitHub URL for user/project@version
Note: this is a clone of repo-utils/parse-github-repo-url with additional parsers, since my pull request was in limbo for a very long time.
Parse all the stupid ways you could write a GitHub URL in your damn package.json.
Supports:
<user>/<repo#<commit>git:// and .git w/ #commit or @versiongit@ and https:git@www.github.comgitlab.<my company name>.com/user/repo.git parsingversion could be falsey, a semantic version, a commit, or a branch, etc.
var parse = require('@bahmutov/parse-github-repo-url')
parse('component/emitter#1') // => ['component', 'emitter', '1']
See the tests for all the different types of supported URLs.
Copyright 2013 - present © cnpmjs.org | Home |