octonode
Advanced tools
Comparing version 0.9.3 to 0.9.4
@@ -229,2 +229,15 @@ // Generated by CoffeeScript 1.12.7 | ||
Repo.prototype.releaseByTag = function(tag, cb) { | ||
return this.client.get("/repos/" + this.name + "/releases/tags/" + tag, function(err, s, b, h) { | ||
if (err) { | ||
return cb(err); | ||
} | ||
if (s !== 200) { | ||
return cb(new Error("Repo releaseByTag error")); | ||
} else { | ||
return cb(null, b, h); | ||
} | ||
}); | ||
}; | ||
Repo.prototype.createRelease = function(release, cb) { | ||
@@ -231,0 +244,0 @@ return this.client.post("/repos/" + this.name + "/releases", release, function(err, s, b, h) { |
{ | ||
"name": "octonode", | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"author": "Pavan Kumar Sunkara <pavan.sss1991@gmail.com> (http://pksunkara.github.com)", | ||
@@ -15,3 +15,3 @@ "description": "nodejs wrapper for github v3 api", | ||
"scripts": { | ||
"test": "vows --spec $(find test -name '*.js')", | ||
"test": "vows --spec test/auth/index.js", | ||
"lib": "./node_modules/coffee-script/bin/cake lib", | ||
@@ -22,3 +22,3 @@ "watch": "./node_modules/coffee-script/bin/cake watch" | ||
"bluebird": "^3.5.0", | ||
"deep-extend": "^0.5.1", | ||
"deep-extend": "^0.6.0", | ||
"randomstring": "^1.1.5", | ||
@@ -29,3 +29,3 @@ "request": "^2.72.0" | ||
"coffee-script": "^1.12.4", | ||
"nock": "^8.0.0", | ||
"nock": "^9.4.3", | ||
"vows": "^0.8.1" | ||
@@ -32,0 +32,0 @@ }, |
@@ -232,2 +232,18 @@ # octonode [![Gitter chat](https://badges.gitter.im/pksunkara/octonode.svg)](https://gitter.im/pksunkara/octonode) | ||
## Async / Promises | ||
If you would like to work with promises rather than callbacks, you can call the promise based version of any of the api calls by appending `Async` to the function call. | ||
For example `prs()` becomes `prsAsync()` like this: | ||
```js | ||
async function getPullRequests () { | ||
const client = github.client(config.githubAccessToken) | ||
const repo = client.repo('pksunkara/octonode') | ||
const result = await repo.prsAsync({ per_page: 100 }) | ||
return result[0] | ||
} | ||
``` | ||
## Pagination | ||
@@ -234,0 +250,0 @@ |
156601
22
3479
1690
+ Addeddeep-extend@0.6.0(transitive)
- Removeddeep-extend@0.5.1(transitive)
Updateddeep-extend@^0.6.0