GitHub.js

Reading and manipulating gists

var GitHub = require('github-api');

// unauthenticated client
var gh = new GitHub({
  username: 'foo',
  password: 'bar'
});

var gist = gh.getGist(); // not a gist yet
var data = {
   public: true,
   description: 'My first gist',
   files: {
      "file1.txt": {
         contents: "Aren't gists great!"
      }
   }
};

gist.create(data)
  .then(function(httpResponse) {
     var gistJson = httpResponse.data;

     // Callbacks too
     gist.read(function(err, gist, xhr) {
        // if no error occurred then err == null
        // gistJson == httpResponse.data
        // xhr == httpResponse
     });
  });
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy