Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 1.01 KB

.verb.md

File metadata and controls

41 lines (26 loc) · 1.01 KB

Usage

The main export is a constructor function that is used to create new Question objects, which are used in prompts by [base-prompt][].

var Question = require('{%= name %}');
var question = new Question('color', 'What is favorite color?');

Examples

Any of the following signatures may be used:

var question = new Question('color'); // sets message as the same value as `name`
var question = new Question('color', 'What is favorite color?');
var question = new Question('color', {message: 'What is favorite color?'});
var question = new Question({name: 'color', message: 'What is favorite color?'});
var question = new Question({name: 'color'});

API

{%= apidocs("index.js") %}

Release history

v5.0.0

  • Support .choices as a function

v4.0.0

  • bumps [prompt-choices][]

v3.0.0

  • bumps [prompt-choices][]

v2.0.0

  • bumps [prompt-choices][]. A major bump was warranted due to potentially breaking changes in prompt-choices. Please see that library for more details.