diff --git a/.verb.md b/.verb.md index 00370d6..22028ab 100644 --- a/.verb.md +++ b/.verb.md @@ -2,11 +2,17 @@ > {%= description %} +**HEADS UP! Breaking changes in 0.3.0!!!** + +See the [release history](#history) for details. + **Why another GitHub URL parser library?** -Seems like every lib I've found does too much, like both stringifying and parsing, or converts the URL from one format to another, only returns certain segments of the URL except for what I need, yields inconsistent results or has poor coverage. +Seems like every lib I've found does too much, like both stringifying and parsing, or converts the URL from one format to another, only returns certain segments of the URL except for what I need, yields inconsistent results or has poor coverage. -{%= include("install-npm", {save: true}) %} +## TOC + + ## Usage @@ -19,9 +25,9 @@ Results in: ```js { - "user": "jonschlinkert", - "repo": "micromatch", - "repopath": "jonschlinkert/micromatch", + "owner": "jonschlinkert", + "name": "micromatch", + "repo": "jonschlinkert/micromatch", "branch": "master" } ``` @@ -33,279 +39,289 @@ Generated results from test fixtures: ```js // assemble/verb#1.2.3 { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "1.2.3" } // assemble/verb#branch { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "branch" } // assemble/verb { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // git+https://github.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // git+ssh://github.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // git://gh.pages.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // git://github.assemble.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // git://github.assemble.two.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // git://github.com/assemble/verb { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // git://github.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // git@gh.pages.com:assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // git@github.com:assemble/verb.git#1.2.3 { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "1.2.3" } // git@github.com:assemble/verb.git#v1.2.3 { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "v1.2.3" } // git@github.com:assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // github:assemble/verb { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // http://github.com/assemble { - "user": "assemble", + "owner": "assemble", + "name": null, "repo": null, - "repopath": null, "branch": "master" } // http://github.com/assemble/verb { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // http://github.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // http://github.com/assemble/verb/tree { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // http://github.com/assemble/verb/tree/master { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // http://github.com/assemble/verb/tree/master/foo/bar { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master/foo/bar" } // https://assemble.github.com/assemble/verb/somefile.tar.gz { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // https://assemble.github.com/assemble/verb/somefile.zip { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // https://assemble@github.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // https://gh.pages.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // https://github.com/assemble/verb { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // https://github.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // https://github.com/assemble/verb/blob/1.2.3/README.md { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "1.2.3" } // https://github.com/assemble/verb/blob/249b21a86400b38969cee3d5df6d2edf8813c137/README.md { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // https://github.com/assemble/verb/blob/master/assemble/index.js { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // https://github.com/assemble/verb/tree/1.2.3 { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "1.2.3" } // https://github.com/assemble/verb/tree/feature/1.2.3 { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "feature/1.2.3" } // https://github.com/repos/assemble/verb/tarball { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // https://github.com/repos/assemble/verb/zipball { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } ``` ## Related projects -{%= related(['is-git-url']) %} +{%= related(verb.related.list) %} + +## History + +**v0.3.0** + +To be more consistent with node.js/package.json conventions, the following properties were renamed in `v0.3.0`: + +- `repo` is now `name` (project name) +- `repopath` is now `repository` (project repository) +- `user` is now `owner` (project owner or org) ## Running tests {%= include("tests") %} @@ -318,7 +334,7 @@ Generated results from test fixtures: ## License {%= copyright() %} -{%= license() %} +{%= license %} *** diff --git a/README.md b/README.md index ad9781e..2298917 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,27 @@ -# parse-github-url [![NPM version](https://badge.fury.io/js/parse-github-url.svg)](http://badge.fury.io/js/parse-github-url) [![Build Status](https://travis-ci.org/jonschlinkert/parse-github-url.svg)](https://travis-ci.org/jonschlinkert/parse-github-url) - +# parse-github-url [![NPM version](https://img.shields.io/npm/v/parse-github-url.svg)](https://www.npmjs.com/package/parse-github-url) [![Build Status](https://img.shields.io/travis/jonschlinkert/parse-github-url.svg)](https://travis-ci.org/jonschlinkert/parse-github-url) > Parse a github URL into an object. +**HEADS UP! Breaking changes in 0.3.0!!!** + +See the [release history](#history) for details. + **Why another GitHub URL parser library?** -Seems like every lib I've found does too much, like both stringifying and parsing, or converts the URL from one format to another, only returns certain segments of the URL except for what I need, yields inconsistent results or has poor coverage. +Seems like every lib I've found does too much, like both stringifying and parsing, or converts the URL from one format to another, only returns certain segments of the URL except for what I need, yields inconsistent results or has poor coverage. -## Install with [npm](npmjs.org) +## TOC -```bash -npm i parse-github-url --save -``` +- [Usage](#usage) +- [Example results](#example-results) +- [Related projects](#related-projects) +- [History](#history) +- [Running tests](#running-tests) +- [Contributing](#contributing) +- [Author](#author) +- [License](#license) + +_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ ## Usage @@ -24,9 +34,9 @@ Results in: ```js { - "user": "jonschlinkert", - "repo": "micromatch", - "repopath": "jonschlinkert/micromatch", + "owner": "jonschlinkert", + "name": "micromatch", + "repo": "jonschlinkert/micromatch", "branch": "master" } ``` @@ -38,304 +48,315 @@ Generated results from test fixtures: ```js // assemble/verb#1.2.3 { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "1.2.3" } // assemble/verb#branch { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "branch" } // assemble/verb { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // git+https://github.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // git+ssh://github.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // git://gh.pages.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // git://github.assemble.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // git://github.assemble.two.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // git://github.com/assemble/verb { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // git://github.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // git@gh.pages.com:assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // git@github.com:assemble/verb.git#1.2.3 { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "1.2.3" } // git@github.com:assemble/verb.git#v1.2.3 { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "v1.2.3" } // git@github.com:assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // github:assemble/verb { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // http://github.com/assemble { - "user": "assemble", + "owner": "assemble", + "name": null, "repo": null, - "repopath": null, "branch": "master" } // http://github.com/assemble/verb { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // http://github.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // http://github.com/assemble/verb/tree { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // http://github.com/assemble/verb/tree/master { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // http://github.com/assemble/verb/tree/master/foo/bar { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master/foo/bar" } // https://assemble.github.com/assemble/verb/somefile.tar.gz { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // https://assemble.github.com/assemble/verb/somefile.zip { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // https://assemble@github.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // https://gh.pages.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // https://github.com/assemble/verb { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // https://github.com/assemble/verb.git { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // https://github.com/assemble/verb/blob/1.2.3/README.md { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "1.2.3" } // https://github.com/assemble/verb/blob/249b21a86400b38969cee3d5df6d2edf8813c137/README.md { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // https://github.com/assemble/verb/blob/master/assemble/index.js { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // https://github.com/assemble/verb/tree/1.2.3 { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "1.2.3" } // https://github.com/assemble/verb/tree/feature/1.2.3 { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "feature/1.2.3" } // https://github.com/repos/assemble/verb/tarball { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } // https://github.com/repos/assemble/verb/zipball { - "user": "assemble", - "repo": "verb", - "repopath": "assemble/verb", + "owner": "assemble", + "name": "verb", + "repo": "assemble/verb", "branch": "master" } ``` ## Related projects -[is-git-url](https://github.com/jonschlinkert/is-git-url): Regex to validate that a URL is a git url. + +[is-git-url](https://www.npmjs.com/package/is-git-url): Regex to validate that a URL is a git url. | [homepage](https://github.com/jonschlinkert/is-git-url) + +## History + +**v0.3.0** + +To be more consistent with node.js/package.json conventions, the following properties were renamed in `v0.3.0`: + +* `repo` is now `name` (project name) +* `repopath` is now `repository` (project repository) +* `user` is now `owner` (project owner or org) ## Running tests + Install dev dependencies: -```bash -npm i -d && npm test +```sh +$ npm i -d && npm test ``` - ## Contributing -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/parse-github-url/issues) +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/parse-github-url/issues/new). ## Author **Jon Schlinkert** - + [github/jonschlinkert](https://github.com/jonschlinkert) - + [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) ## License -Copyright (c) 2015 Jon Schlinkert -Released under the MIT license + +Copyright © 2016 [Jon Schlinkert](https://github.com/jonschlinkert) +Released under the MIT license. *** -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 25, 2015._ +_This file was generated by [verb](https://github.com/verbose/verb) on January 17, 2016._ \ No newline at end of file