Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (35 sloc) 1.02 KB

Gisty

A Node.JS wrapper for Gist's API v3.

How to use in JavaScript

var Gisty = require('gisty').Gisty;

var gist = new Gisty({username: meritt});

gist.fetch('1111422', function(error, gist) {
    if (error) {
      throw new Error(error);
    }
    for (filename in gist.files) {
        console.log(filename + "\n" + gist.files[filename].content + "\n\n");
    }
});

Or with CoffeeScript

Gisty = require('gisty').Gisty

gist = new Gisty username: 'meritt'

gist.fetch '1111422', (error, gist) ->
    throw new Error error if error
    console.log filename + "\n" + file.content + "\n\n" for filename, file of gist.files

Install with NPM

npm install gisty

API

  • fetch (gist id, callback)
  • comments (gist id, callback)
  • all (callback)
  • public (callback)
  • starred (callback)

Author

Something went wrong with that request. Please try again.