Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

inquiry-traverser

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inquiry-traverser

A Promise based wrapper for prompting branched questions with Inquirer.js

  • 0.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

inquiry-traverser

npm version dependencies dev dependencies peer dependencies

A Promise based wrapper for prompting branched questions with Inquirer.js and alternatives using the same API, such as inquirer-shortcuts

Documentation

Installation

$ npm install inquiry-traverser
var inquirer = require('inquirer');
var traverser = require('inquiry-traverser');

var traverse = traverser(inquirer);

traverse({ /* Put your branched questions object here */ })
  .then(function onResolve (value) {
    // Handle a successfull resolution ...
  })
  .catch(function onReject (reason) {
    // Handle a rejection ...
  });

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 resolves the returned promise with user's responses to all prompted questions, the Promise returned by inquiry-traverser receives only 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 :)

Keywords

FAQs

Package last updated on 30 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc