Created
April 6, 2019 09:56
-
-
Save korzio/309193eca19f9e3c9d03c9ec21937d71 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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