online-branch-exist
Advanced tools
Comparing version 1.0.0 to 1.0.1
## v1.0.1 / January 30, 2015 | ||
- Release v1.0.1 / npm@v1.0.1 | ||
- update readme docs | ||
## v1.0.0 / January 30, 2015 | ||
- Release v1.0.0 / npm@v1.0.0 | ||
- fix deps version ranges | ||
@@ -5,0 +10,0 @@ - add keywords |
{ | ||
"name": "online-branch-exist", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Async (with callback api) check through github api if branch exists in the `user/repo`, you can use `user/repo[#branch]` for the check", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -12,9 +12,17 @@ ## [![npm][npmjs-img]][npmjs-url] [![mit license][license-img]][license-url] [![build status][travis-img]][travis-url] [![coverage status][coveralls-img]][coveralls-url] [![deps status][daviddm-img]][daviddm-url] | ||
## Usage | ||
## API | ||
> For more use-cases see the [tests](./test.js) | ||
### [onlineBranchExist](./index.js#L22) | ||
> Checks that given `branch` exists in github repo, using `user/repo#branch` string pattern | ||
- `pattern` **{String}** | ||
- `callback` **{Function}** | ||
**Example:** | ||
```js | ||
var onlineBranchExist = require('online-branch-exist'); | ||
var onlineExist = require('online-branch-exist'); | ||
onlineBranchExist('tunnckoCore/koa-better-body#master', function(err, res) { | ||
onlineExist('tunnckoCore/koa-better-body#master', function(err, res) { | ||
if (err) { | ||
@@ -29,3 +37,46 @@ console.error(err); | ||
### [.branch](./index.js#L22) | ||
> Checks that given `branch` exists in github repo, using `user/repo#branch` string pattern | ||
> Actually same as above. | ||
- `pattern` **{String}** | ||
- `callback` **{Function}** | ||
**Example:** | ||
```js | ||
var onlineExist = require('online-branch-exist'); | ||
onlineExist.branch('koajs/koa#proxy', function(err, res) { | ||
if (err) { | ||
console.error(err); | ||
return; | ||
} | ||
console.log(res); | ||
//=> true | ||
}) | ||
``` | ||
### [.tag](./index.js#L26) | ||
> Checks that given `tag` exists in github repo, using `user/repo#tag` string pattern | ||
- `pattern` **{String}** | ||
- `callback` **{Function}** | ||
**Example:** | ||
```js | ||
var onlineExist = require('online-branch-exist'); | ||
onlineExist.tag('hybridables/handle-arguments#v2.0.0', function(err, res) { | ||
if (err) { | ||
console.error(err); | ||
return; | ||
} | ||
console.log(res); | ||
//=> true | ||
}) | ||
``` | ||
## Author | ||
@@ -32,0 +83,0 @@ **Charlike Mike Reagent** |
17078
119