2.0.4 • Published 2 years ago

@xandrrrr/prompt-kit v2.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Prompt Kit

Build interactive command line interfaces with ease. This package only works in a TTY-enabled environment. If the package is used in a non-TTY environment, it will print a warning that can be suppressed by setting the PROMPTKIT_DISABLE_TTY_WARNING environment variable to true.

Installation

To install the latest version, run:

npm install prompt-kit

Usage

const { SelectionBuilder } = require('prompt-kit');

const selection = new SelectionBuilder()
  .setPrompt('Select a color')
  .setOptions([
    { option: 'red', value: 'red' },
    { option: 'green', value: 'green' },
    { option: 'blue', value: 'blue' },
  ])
  .build()
  .then((selected) => {
    console.log(`You selected ${selected.map((s) => s.value).join(', ')}`);
  });

Documentation

You can find the documentation here.

2.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

1.8.0

2 years ago

1.7.1

2 years ago

1.7.0

2 years ago

1.6.0

2 years ago

1.4.0

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago