title: How to set default value for an answer using inquirer?
body: <p>I am trying to create a small build script which will ask the user for the location to the mysql headers if they are not found in the default path. Right now I am using <a href="https://github.com/SBoudrias/Inquirer.js" rel="nofollow noreferrer"><code>inquirer</code></a> to prompt the user for input which works fine, but I have encountered the following problem:</p>
  
  <pre><code>'use strict'
  const inquirer = require('inquirer')
  const fs = require('fs')
  
  const MYSQL_INCLUDE_DIR = '/usr/include/mysql'
  
  let questions = [
    {
      type: 'input',
      name: 'MYSQL_INCLUDE_DIR',
      message: 'Enter path to mysql headers',
      default: MYSQL_INCLUDE_DIR,
      when: (answers) =&gt; {
        return !fs.existsSync(MYSQL_INCLUDE_DIR)
      },
      validate: (path) =&gt; {
        return fs.existsSync(path)
      }
    }
  ]
  
  inquirer.prompt(questions)
    .then((answers) =&gt; {
      // Problem is that answers.MYSQL_INCLUDE_DIR might be undefined at this point.
    })
  </code></pre>
  
  <p>If the default path to the mysql headers are found then the question will not be displayed and therefor the answer will not be set. How can I set a default value for a question without actually showing it to the user?</p>
  
  <p>Solving the above would also make it possible to do this instead of using the global variable:</p>
  
  <pre><code>let questions = [
    {
      type: 'input',
      name: 'MYSQL_INCLUDE_DIR',
      message: 'Enter path to mysql headers',
      default: MYSQL_INCLUDE_DIR,
      when: (answers) =&gt; {
        return !fs.existsSync(answers.MYSQL_INCLUDE_DIR)
      },
      validate: (path) =&gt; {
        return fs.existsSync(path)
      }
    }
  ]
  </code></pre>