parse-github-repo-url
Parse a GitHub URL for user/project@version
Last updated 11 years ago by jongleberry .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install parse-github-repo-url 
SYNC missed versions from official npm registry.

parse-github-repo-url

Parse a GitHub URL for user/project@version

Build Status semantic-release

Features

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 @version
  • git@ and https:git@
  • www.github.com
  • gitlab.<my company name>.com/user/repo.git parsing
  • All 5 different ways you could download a freaking tarball/zipball

API

[user, repo, version] = parse(url)

version could be falsey, a semantic version, a commit, or a branch, etc.

var parse = require('parse-github-repo-url')
parse('component/emitter#1') // => ['component', 'emitter', '1']

See the tests for all the different types of supported URLs.

Current Tags

  • 1.4.1                                ...           latest (7 years ago)

5 Versions

  • 1.4.1                                ...           7 years ago
  • 1.4.0                                ...           8 years ago
  • 1.3.0                                ...           9 years ago
  • 1.2.0                                ...           9 years ago
  • 1.0.0                                ...           11 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)

Copyright 2013 - present © cnpmjs.org | Home |