index.js
function askForGithubAuth (options, cb) {
  if (typeof options === 'function') {
    cb = options;
    options = {};
  }
  options = options || {};
  options.store = options.store || 'default';
  if (typeof options.store === 'string') {
    options.store = 'for-github-auth.' + options.store;
  }
  loadQuestions(options.store);

  var creds = {};
  ask.once('github-auth.type', options, function (err, type) {
    if (err) return cb(err);

    creds.type = type;
    ask.once(['github-auth', type].join('.'), options, function (err, answer) {
      if (err) return cb(err);

      if (type === 'oauth') {
        creds.token = answer;
      } else {
        creds.username = answer.username;
        creds.password = answer.password;
      }
      cb(null, creds);
    });
  });
}
function askForGithubAuth (options, cb) {
  if (typeof options === 'function') {
    cb = options;
    options = {};
  }
  options = options || {};
  options.store = options.store || 'default';
  if (typeof options.store === 'string') {
    options.store = 'for-github-auth.' + options.store;
  }
  loadQuestions(options.store);

  var creds = {};
  ask.once('github-auth.type', options, function (err, type) {
    if (err) return cb(err);

    creds.type = type;
    ask.once(['github-auth', type].join('.'), options, function (err, answer) {
      if (err) return cb(err);

      if (type === 'oauth') {
        creds.token = answer;
      } else {
        creds.username = answer.username;
        creds.password = answer.password;
      }
      cb(null, creds);
    });
  });
}
function askForGithubAuth ( options , cb ) { if ( typeof options === 'function' ) { cb = options ; options = { } ; } options = options || { } ; options . store = options . store || 'default' ; if ( typeof options . store === 'string' ) { options . store = 'for-github-auth.' + options . store ; } loadQuestions ( options . store ) ; var creds = { } ; ask . once ( 'github-auth.type' , options , function ( err , type ) { if ( err ) return cb ( err ) ; creds . type = type ; ask . once ( [ 'github-auth' , type ] . join ( '.' ) , options , function ( err , answer ) { if ( err ) return cb ( err ) ; if ( type === 'oauth' ) { creds . token = answer ; } else { creds . username = answer . username ; creds . password = answer . password ; } cb ( null , creds ) ; } ) ; } ) ; }
Prompt a user for their github authentication credentials.
Save the answer so they're only asked once.

```js
ask(function (err, creds) {
console.log(creds);
//=>    {type: 'oauth', token: '123456'}
//=> or {type: 'basic', username: 'doowb', password: 'password'}
});
```

@param  {Object} `options` Options to pass to [ask-once][]
@param  {String} `options.store` a [data-store][] instance or name that can be passed to [ask-once][]
@param  {Function} `cb` Callback function returning either an error or authentication credentials
@api public
Prompt a user for their github authentication credentials . Save the answer so they re only asked once .