What is generate?

Generate is a node.js library for composing and running prompts in the terminal.

What's different about generate?

Generate itself can be thought of as a "prompt runner" that only ships with one prompt type, input, and additional prompt types are added as plugins.

This makes generate lighter, faster, easier to maintain and easier to extend than other prompt libraries, like inquirer. Generate also supports the same question formats as inquirer, as well as additional formats that make it easier to create.

Prompt types

The following prompt types are maintained by the Generate core team. Each is published as a separate library and can be used completely standalone, or as a plugin to Generate.

Visit the prompts documentation to learn more about using, discovering and authoring prompts.

Quickstart

1. Install

Install with npm:

$ npm install --save generate

2. Prompt

Add the following code to example.js then run $ node example:

var Generate = require('generate');
var generate = new Generate();

generate.question('first', 'First name?');
generate.question('last', 'Last name?');

generate.prompt(['first', 'last'])
  .then(function(answers) {
    console.log(answers)
  });

Next steps

Resources