github-api-promise
Advanced tools
Comparing version 1.9.1 to 1.10.0
{ | ||
"name": "github-api-promise", | ||
"version": "1.9.1", | ||
"version": "1.10.0", | ||
"description": "A node module for interfacing with the Github API using promises", | ||
@@ -5,0 +5,0 @@ "main": "src/app.js", |
@@ -0,1 +1,3 @@ | ||
const req = require('./request-helpers'); | ||
var githubApi = {}; | ||
@@ -28,2 +30,4 @@ | ||
githubApi.getRequestCount = () => { return req.requestCount; }; | ||
// Set to window object if there is a window | ||
@@ -30,0 +34,0 @@ if(typeof window !== 'undefined') { |
@@ -10,2 +10,4 @@ const _ = require('lodash'); | ||
module.exports = { | ||
requestCount: 0, | ||
logRequestSuccess: function(res, message) { | ||
@@ -20,2 +22,3 @@ if (config.debug !== true) { | ||
(message ? message : '')); | ||
log.debug(`Requests remaining: ${res.headers['x-ratelimit-remaining']}/${res.headers['x-ratelimit-limit']}, reset at ${new Date(res.headers['x-ratelimit-reset']*1000)}`); | ||
}, | ||
@@ -81,2 +84,4 @@ | ||
self.requestCount++; | ||
// Set standard stuff and handle response | ||
@@ -93,2 +98,4 @@ req | ||
function(err) { | ||
// TODO: handle rate limiting (github sends a 403, not a 429) | ||
// https://developer.github.com/v3/#rate-limiting | ||
log.error(err); | ||
@@ -95,0 +102,0 @@ deferred.reject(err.message); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74177
1585