Skip to content

Instantly share code, notes, and snippets.

@korzio
Created April 6, 2019 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save korzio/309193eca19f9e3c9d03c9ec21937d71 to your computer and use it in GitHub Desktop.
Save korzio/309193eca19f9e3c9d03c9ec21937d71 to your computer and use it in GitHub Desktop.
const inquirer = require('inquirer')
const questions = require(questionsFile)
.map(({
question,
options
}, i) => ({  
type: 'list',
message: question,
choices: options,
name: `${i}`,
}))
function start() { 
return inquirer.prompt(questions)
.then((result) => { 
console.log('Command-line input received:') 
console.log(JSON.stringify(result)) 
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment