Comments (2)
Example that works (app.js
):
import Log from './log';
import './init';
import inquirer from 'inquirer';
const log = new Log();
log.debug(__('app.welcome_banner'));
const choices = [];
choices.push({ name: 'Foo', value: 1 });
choices.push({ name: 'Bar', value: 2 });
inquirer.prompt([
{
type: 'list',
name: 'blabla', // result hash property
message: 'Select something maybe?',
choices: choices
}
]).then((result) => {
console.log(result);
});
Result:
step 1:
? Select something maybe? (Use arrow keys)
Foo
❯ Bar
Click ENTER above ^^^
step 2:
? Select something maybe? Bar
{ blabla: 2 }
from libretaxi.
Show list of options:
import Log from './log';
import './init';
import OptionsResponseHandler from './response-handlers/cli/options-response-handler';
import OptionsResponse from './responses/options-response';
const log = new Log();
log.debug(__('app.welcome_banner'));
const h = new OptionsResponseHandler({
response: new OptionsResponse({
rows: [
[{ label: 'One', value: '1' },{ label: 'Two', value: '2' },{ label: 'Three', value: '3' }],
[{ label: 'OK', value: 'ok' },{ label: 'Cancel', value: 'cancel' }]
]
})
});
h.call();
Result:
? Your choice? (Use arrow keys)
❯ One
Two
Three
OK
Cancel
from libretaxi.
Related Issues (20)
- Yet npm install errors HOT 5
- put to work in background server
- Change Port to Listen HOT 1
- How to run this with Whatsapp HOT 1
- Is telegram a must have HOT 1
- Unhandled exception: Drive has not been shared HOT 1
- login failed HOT 1
- Implement /mute /unmute commands HOT 1
- Init Bot api failed HOT 1
- About the selection of message queue HOT 1
- dep ensure Error#1-- go.uber.org/ratelimit in Gopkg.toml
- Program a bot for xmpp
- Is there a plan to make docs for this program?
- Test-check today
- Can someone help me setup the libretaxi setup on windows HOT 1
- Error step "go build" HOT 1
- LibreTaxi available on F-Droid HOT 3
- Website certificate expired HOT 1
- Is it still working? HOT 2
- How to change bot language HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libretaxi.