Check the environment variables, if it exists user does not need to input.
const gimmeMahVariable = _ =>
process.env.yourVariable
? Promise.resolve(process.env.yourVariable)
: inquirer.prompt({
// stuff...
})
gimmeMahVariable()
.then(_mahVariable => // ...
Most helpful comment