listr-inquirer

0.1.0 • Public • Published

Input module for Listr

Install

$ npm install --save listr-input

Usage

const Listr = require('listr');
const inquirer = require('listr-inquirer');
 
const list = new Listr([
    {
        title: 'Retrieving data',
        task: (ctx, task) => inquirer([
            {
                type: 'confirm',
                name: 'continue',
                message: 'Do you want to continue?'
            }
        ], function (answers) {
            if (false === answers.continue) {
                task.skip('Skipped')
            }
        })
    }
]);
 
list.run();

API

input(questions, done)

Returns an Observable which asks given set of questions.

questions

Type: array

https://github.com/SBoudrias/Inquirer.js/#question

done

Type: function

Function that will be invoked when the user has answered the questions

License

MIT © Original code from listr-input by Sam Verschueren

Package Sidebar

Install

npm i listr-inquirer

Weekly Downloads

2,361

Version

0.1.0

License

MIT

Unpacked Size

3.84 kB

Total Files

4

Last publish

Collaborators

  • pion