Skip to content

Instantly share code, notes, and snippets.

@JeremyEnglert
Created October 12, 2018 08:11
Show Gist options
  • Save JeremyEnglert/2d94cb11056614dd9418d567ae8e7816 to your computer and use it in GitHub Desktop.
Save JeremyEnglert/2d94cb11056614dd9418d567ae8e7816 to your computer and use it in GitHub Desktop.
Inquirer Promise Chaining
inquirer
.prompt([
{
type: 'list',
name: 'framework',
message: 'What framework would you like to install?',
choices: ['None', 'Foundation', 'Bootstrap'],
}
])
.then(answers => {
downloadFramework(answers.framework); // This takes some time as it downloads a file
})
.then(() => {
console.log("Install successful! Run 'npm build' to get started."); // Only want this to happen after the above download is complete
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment