Like yeoman/generator-generator/app/index.js.
var GitHubApi = require('github');
github.user.getFrom({
user: name
}, function (err, res) {
if (err) {
log.error('Cannot fetch your github profile. Make sure you\'ve typed it correctly.');
res = emptyGithubRes;
}
cb(JSON.parse(JSON.stringify(res)));
})