Socket
Socket
Sign inDemoInstall

parse-github-repo-url

Package Overview
Dependencies
0
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-github-repo-url

Parse a GitHub URL for user/project@version


Version published
Maintainers
3
Weekly downloads
267,376
increased by6.36%
Install size
5.59 kB

Weekly downloads

Readme

Source

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.

FAQs

Last updated on 31 Aug 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc