const readLineSync = require('readline-sync'), items = ['option 1', 'option 2', 'option 3'], index = readLineSync.keyInSelect(items); console.log('you chose ' + items[index]);
console.log('you chose ' + index);