Created
October 12, 2018 08:11
-
-
Save JeremyEnglert/2d94cb11056614dd9418d567ae8e7816 to your computer and use it in GitHub Desktop.
Inquirer Promise Chaining
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
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