#--@STCGoal Create Gist really quickly when experimenting
##--@STCIssue Why creating Gist when Experimenting ?
Well, what else ??
const GitHub = require("github-api");
// basic auth
var gh = new GitHub({
//@STCGoal Create Gist really quickly when experimenting
//@STCIssue Why creating Gist when Experimenting ?
token: 'A TOKEN WITH ONLY GIST CREATE PERMISSION'
/* also acceptable:
username: 'jgwill',
password: 'MYPASSWORD'
*/
});
// const gh = new GitHub();
let gist = gh.getGist(); // not a gist yet
gist.create({
public: true,
description: '@STCGoal Create Gist really quickly when experimenting',
files: {
"x__github_api__nodejs__2012030818.dissimination-method-.md": {
content: "#--@STCIssue Why creating Gist when Experimenting ?\n\n* Some bullet point on it"
}
}
}).then(function({data}) {
// Promises!
let createdGist = data;
return gist.read();
}).then(function({data}) {
let retrievedGist = data;
// do interesting things
});