inquirer-questions-counter

1.0.1 • Public • Published

Build Status XO code style Dependencies

Inquirer's questions counter

Adds counter to inquirer's questions.

Install

$ npm install --save inquirer-questions-counter

Usage

const inquirer = require('inquirer');
const addCounter = require('inquirer-questions-counter');
 
const askName = {
  type: 'input',
  name: 'name',
  message: `What's your name?`
};
 
inquirer.prompt(addCounter([askName], '{current}/{total}: '));
 
//=> ? 1/1: What's your name?

API

addCounter(questions, [format])

questions

Type: array

Array of inquirer questions

format

Type: string
Default: {current}/{total}

Format of displayed counter. Available variables:

  • {current} represent current question's number
  • {total} represents total amount of questions

License

MIT © Alexey Lizurchik

Package Sidebar

Install

npm i inquirer-questions-counter

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • alizurchik