index.js
function Question(name, message, options) {
  debug('initializing from <%s>', __filename);
  if (arguments.length === 0) {
    throw new TypeError('expected a string or object');
  }

  if (Question.isQuestion(name)) {
    return name;
  }

  this.type = 'input';
  this.options = {};
  this.getDefault();

  if (Array.isArray(message)) {
    options = { choices: message };
    message = name;
  }

  if (Array.isArray(options)) {
    options = { choices: options };
  }

  define(this, 'Choices', Choices);
  define(this, 'isQuestion', true);
  utils.assign(this, {
    name: name,
    message: message,
    options: options
  });
}
function Question(name, message, options) {
  debug('initializing from <%s>', __filename);
  if (arguments.length === 0) {
    throw new TypeError('expected a string or object');
  }

  if (Question.isQuestion(name)) {
    return name;
  }

  this.type = 'input';
  this.options = {};
  this.getDefault();

  if (Array.isArray(message)) {
    options = { choices: message };
    message = name;
  }

  if (Array.isArray(options)) {
    options = { choices: options };
  }

  define(this, 'Choices', Choices);
  define(this, 'isQuestion', true);
  utils.assign(this, {
    name: name,
    message: message,
    options: options
  });
}
function Question ( name , message , options ) { debug ( 'initializing from <%s>' , __filename ) ; if ( arguments . length === 0 ) { throw new TypeError ( 'expected a string or object' ) ; } if ( Question . isQuestion ( name ) ) { return name ; } this . type = 'input' ; this . options = { } ; this . getDefault ( ) ; if ( Array . isArray ( message ) ) { options = { choices : message } ; message = name ; } if ( Array . isArray ( options ) ) { options = { choices : options } ; } define ( this , 'Choices' , Choices ) ; define ( this , 'isQuestion' , true ) ; utils . assign ( this , { name : name , message : message , options : options } ) ; }
Create a new question with the given `name`, `message` and `options`.

```js
var question = new Question('first', 'What is your first name?');
console.log(question);
// {
//   type: 'input',
//   name: 'color',
//   message: 'What is your favorite color?'
// }
```
@param {String|Object} `name` Question name or options.
@param {String|Object} `message` Question message or options.
@param {String|Object} `options` Question options.
@api public
Create a new question with the given name message and options .