Skip to content

Instantly share code, notes, and snippets.

@queerviolet
Created April 19, 2016 16:15
Show Gist options
  • Save queerviolet/488c4c18177ea8b61d0c5ca78237e026 to your computer and use it in GitHub Desktop.
Save queerviolet/488c4c18177ea8b61d0c5ca78237e026 to your computer and use it in GitHub Desktop.
Inquirer prompt function
var inquirer = require('inquirer')
inquirer.prompt([
{ name: 'choice',
message: 'Pick a color',
type: 'list',
choices: [
{name: 'Red', value: '#ff0000'},
{name: 'Green', value: '#00ff00'},
{name: 'Fuchsia', value: '#ff00ff'},
]
}
]).then(function(answers) {
console.log(answers.choice)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment