parse-github-short-url
Parse a github/npm shorthand (user/repo#branch or user/repo@version) URL into an object.
Last updated 10 years ago by tunnckocore .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install parse-github-short-url 
SYNC missed versions from official npm registry.

parse-github-short-url npmjs.com The MIT License

Parse a github/npm shorthand (user/repo#branch or user/repo@version) URL into an object.

code climate standard code style travis build status coverage status dependency status

Install

npm i parse-github-short-url --save

Usage

For more use-cases see the tests

var gh = require('parse-github-short-url')
gh('tunnckoCore/parse-function')

Results in:

{
  "owner": "tunnckoCore",
  "name": "parse-function",
  "repo": "tunnckoCore/parse-function",
  "branch": null,
}

More examples

Or see the tests

// assemble/verb#1.2.3
{
  "owner": "assemble",
  "name": "verb",
  "repo": "assemble/verb",
  "branch": "1.2.3",
}

// assemble/verb@~3.0.5
{
  "owner": "assemble",
  "name": "verb",
  "repo": "assemble/verb",
  "branch": null,
  "version": "~3.0.5"
}

// assemble/verb#dev
{
  "owner": "assemble",
  "name": "verb",
  "repo": "assemble/verb",
  "branch": "dev",
}

// assemble/verb
{
  "owner": "assemble",
  "name": "verb",
  "repo": "assemble/verb",
  "branch": null,
}

// assemble
{
  "owner": "assemble",
  "name": null,
  "repo": null,
  "branch": null,
}

// gulpjs/gulp@v3.8.1
{
  "owner": "gulpjs",
  "name": "gulp",
  "repo": "gulpjs/gulp",
  "branch": null,
  "version": "v3.8.1"
}

Related

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github

Current Tags

  • 3.2.0                                ...           latest (10 years ago)

14 Versions

  • 3.2.0                                ...           10 years ago
  • 3.1.1                                ...           10 years ago
  • 3.1.0                                ...           10 years ago
  • 3.0.1                                ...           10 years ago
  • 3.0.0                                ...           10 years ago
  • 2.0.0                                ...           11 years ago
  • 1.0.5                                ...           11 years ago
  • 1.0.4                                ...           11 years ago
  • 1.0.3                                ...           11 years ago
  • 1.0.2                                ...           11 years ago
  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
  • 0.0.0                                ...           11 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 14
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |