Skip to content

Commit

Permalink
Added Node.js support.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael committed Apr 9, 2013
1 parent 514124d commit da95507
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions github.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
// Github.js 0.7.0
// (c) 2012 Michael Aufreiter, Development Seed
// Github.js 0.8.0
// (c) 2013 Michael Aufreiter, Development Seed
// Github.js is freely distributable under the MIT license.
// For all details and documentation:
// http://substance.io/michael/github

(function() {
var Github;

// Initial Setup
// -------------

if (typeof exports !== 'undefined') {
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
var _ = require('underscore');
}

var API_URL = 'https://api.github.com';

Github = window.Github = function(options) {
var Github = function(options) {

// HTTP Request Abstraction
// =======
Expand Down Expand Up @@ -48,6 +56,8 @@
data ? xhr.send(JSON.stringify(data)) : xhr.send();
}



// User API
// =======

Expand Down Expand Up @@ -496,4 +506,12 @@
return new Github.Gist({id: id});
};
};
}).call(this);


if (typeof exports !== 'undefined') {
// Github = exports;
module.exports = Github;
} else {
window.Github = Github;
}
}).call(this);

0 comments on commit da95507

Please sign in to comment.