1.0.0 • Published 6 years ago

readline-ex v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

node-readline-ex

Extend node-readline, make it easy to use.

QA

Example code:

const {qa} = require('node-readline-ex');

qa.init([
    {
        question: 'what is his name ?',
        default: 'john'
    },
    {
        question: 'what is her name ?',
        default: 'athena'
    },
    {
        question: 'what is your name ?'
    }
]).act((a) => {
    debug(a);
});

And it looks like this:

what is his name ? [john] x
what is her name ? [athena] y
what is your name ? <=== print Enter
what is your name ? <=== print Enter
what is your name ? <=== print Enter
what is your name ?iceman