inquiry-traverser

A Promise based wrapper for prompting branched questions with Inquirer.js.
Documentation
Installation
$ npm install inquiry-traverser
var inquirer = require('inquirer');
var traverser = require('inquiry-traverser');
var traverse = traverser(inquirer);
traverse({ })
.then(function onResolve (value) {
})
.catch(function onReject (reason) {
});
Examples
Check the examples
folder, run the scripts, e.g.
$ node examples/basic-usage.js
The basic-usage
example shows the use of prompts of type confirm
, the module's redirection feature and provokes a rejection on the second prompt due to a missing resolution of one of its results.
The advanced-usage
example uses prompts of type list
, rawlist
and expand
, as well as the redirection feature.
Differences to default Inquirer.js Behaviour
Contrary to the default behaviour of Inquirer.js, which calls the prompts' callback with an Answer object that contains the user's response to all prompted questions, the function called upon resolving the Promise returned by inquiry-traverser
receives a particular value (see the basic usage example).
Todos
Currently inquiry-traverser
lacks a proper documentation and tests. At the moment, even only prompts of type confirm
are tested.
This will change and be more complete soon, hopefully. Until then, feel free to file bug reports or make suggestions. Pull requests welcome :)