Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/repo-utils/parse-github-repo-url
Parse a GitHub URL for user/project@version
https://github.com/repo-utils/parse-github-repo-url
github parsing url
Last synced: 3 days ago
JSON representation
Parse a GitHub URL for user/project@version
- Host: GitHub
- URL: https://github.com/repo-utils/parse-github-repo-url
- Owner: repo-utils
- License: mit
- Created: 2014-04-23T10:24:57.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-10-10T11:02:18.000Z (about 6 years ago)
- Last Synced: 2024-11-05T23:41:25.657Z (9 days ago)
- Topics: github, parsing, url
- Language: JavaScript
- Size: 11.7 KB
- Stars: 30
- Watchers: 7
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# parse-github-repo-url
> Parse a GitHub URL for user/project@version
[![Build Status](https://travis-ci.org/repo-utils/parse-github-repo-url.svg?branch=master)](https://travis-ci.org/repo-utils/parse-github-repo-url)
[![semantic-release][semantic-image] ][semantic-url][semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
[semantic-url]: https://github.com/semantic-release/semantic-release# Features
Parse all the stupid ways you could write a GitHub URL in your damn `package.json`.
Supports:- `/`
- `git://` and `.git` w/ `#commit` or `@version`
- `git@` and `https:git@`
- `www.github.com`
- `gitlab..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 `false`y, a semantic version, a commit, or a branch, etc.
```js
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.