Skip to content

Instantly share code, notes, and snippets.

@pdehaan
Created March 10, 2015 17:13
Show Gist options
  • Save pdehaan/7bd63699ba011d64f87f to your computer and use it in GitHub Desktop.
Save pdehaan/7bd63699ba011d64f87f to your computer and use it in GitHub Desktop.
Creates an anonymous, secret Gist.
'use strict';
var fs = require('fs');
var github = require('octonode');
var client = github.client();
var gist = client.gist();
gist.create({
description: 'gist description',
files: {
'file1.txt': {
content: fs.readFileSync('./file1.txt', 'utf-8')
}
}
}, callback);
function callback(err, data) {
if (err) {
return console.error(err);
}
console.log(JSON.stringify(data, null, 2));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment