All Projects → enquirer → prompt-list

enquirer / prompt-list

Licence: MIT license
This repository has been archived, use Enquirer instead.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to prompt-list

prompt-base
This repository has been archived, use Enquirer instead.
Stars: ✭ 21 (+61.54%)
Mutual labels:  prompt, readline, questions, enquirer
enquirer
Stylish, intuitive and user-friendly prompts, for Node.js. Used by eslint, webpack, yarn, pm2, pnpm, RedwoodJS, FactorJS, salesforce, Cypress, Google Lighthouse, Generate, tencent cloudbase, lint-staged, gluegun, hygen, hardhat, AWS Amplify, GitHub Actions Toolkit, @airbnb/nimbus, and many others! Please follow Enquirer's author: https://github.…
Stars: ✭ 6,523 (+50076.92%)
Mutual labels:  prompt, readline, prompts
Readline Sync
Synchronous Readline for interactively running to have a conversation with the user via a console(TTY).
Stars: ✭ 601 (+4523.08%)
Mutual labels:  prompt, readline
prompt-password-strength
Custom mask function for prompt-password that adds a 'strength progress meter' that changes color as the password strength increases. Uses zxcvbn, the popular password strength estimation tool brought to you by dropbox.
Stars: ✭ 18 (+38.46%)
Mutual labels:  prompt, enquirer
OpenPrompt
An Open-Source Framework for Prompt-Learning.
Stars: ✭ 1,769 (+13507.69%)
Mutual labels:  prompt, prompts
Prompts
❯ Lightweight, beautiful and user-friendly interactive prompts
Stars: ✭ 6,970 (+53515.38%)
Mutual labels:  prompt, prompts
Prompt Checkbox
This repository has been archived, use Enquirer instead.
Stars: ✭ 21 (+61.54%)
Mutual labels:  prompt, readline
Inquirer.js
A collection of common interactive command line user interfaces.
Stars: ✭ 15,378 (+118192.31%)
Mutual labels:  prompt
ama
Ask me anything
Stars: ✭ 33 (+153.85%)
Mutual labels:  questions
Survey
A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
Stars: ✭ 2,843 (+21769.23%)
Mutual labels:  prompt
Quick-notes
This repo contains important notes and code snippets which can help you during your job interviews
Stars: ✭ 37 (+184.62%)
Mutual labels:  questions
readline-and-ncurses
Example demonstrating combining of readline and ncurses
Stars: ✭ 50 (+284.62%)
Mutual labels:  readline
Sweetalert2
A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies.
Stars: ✭ 13,929 (+107046.15%)
Mutual labels:  prompt
Spaceship Prompt
🚀⭐ A Zsh prompt for Astronauts
Stars: ✭ 15,748 (+121038.46%)
Mutual labels:  prompt
react-st-modal
Simple and flexible modal dialog component for React JS
Stars: ✭ 41 (+215.38%)
Mutual labels:  prompt
Common
A simple, clean and minimal prompt.
Stars: ✭ 213 (+1538.46%)
Mutual labels:  prompt
know-your-planet
Quiz de l'Anthropocène : des questions/réponses pour mieux appréhender les limites de notre planète
Stars: ✭ 14 (+7.69%)
Mutual labels:  questions
Sharprompt
Interactive command line interface toolkit for C#
Stars: ✭ 197 (+1415.38%)
Mutual labels:  prompt
rainbow-bash-prompt
Make your bash prompt dynamically and randomly rainbow
Stars: ✭ 49 (+276.92%)
Mutual labels:  prompt
impromptu.nvim
Create prompts fast and easy
Stars: ✭ 39 (+200%)
Mutual labels:  prompt

prompt-list NPM version NPM monthly downloads NPM total downloads Linux Build Status Windows Build Status

List-style prompt. Can be used as a standalone prompt, or with a prompt system like enquirer.

Follow this project's author, Jon Schlinkert, for updates on this project and others.

prompt-list example

Install

Install with npm:

$ npm install --save prompt-list

Install

Install with npm:

$ npm install --save prompt-list

Example usage

var List = require('prompt-list');
var list = new List({
  name: 'order',
  message: 'What would you like to order?',
  // choices may be defined as an array or a function that returns an array
  choices: [
    'Coke',
    'Diet Coke',
    'Cherry Coke',
    {name: 'Sprite', disabled: 'Temporarily unavailable'},
    'Water'
  ]
});

// async
list.ask(function(answer) {
  console.log(answer);
});

// promise
list.run()
  .then(function(answer) {
    console.log(answer);
  });

Enquirer usage

Register the prompt as an enquirer plugin:

var Enquirer = require('enquirer');
var enquirer = new Enquirer();

enquirer.register('list', require('prompt-list'));

Enquirer examples

Enquirer supports both declarative, inquirer-style questions, and an expressive format, using the .question method:

Declarative

var questions = [
  {
    type: 'list',
    name: 'order',
    message: 'What would you like to order?',
    choices: [
      'Coke',
      'Diet Coke',
      'Cherry Coke',
      {name: 'Sprite', disabled: 'Temporarily unavailable'},
      'Water'
    ]
  }
];

enquirer.ask(questions)
  .then(function(answers) {
    console.log(answers);
  })
  .catch(function(err) {
    console.log(err);
  });

Expressive

enquirer.question('order', 'What would you like to order?', {
  type: 'list',
  choices: [
    'Coke',
    'Diet Coke',
    'Cherry Coke',
    {name: 'Sprite', disabled: 'Temporarily unavailable'},
    'Water'
  ]
});

enquirer.ask(['order'])
  .then(function(answers) {
    console.log(answers);
  })
  .catch(function(err) {
    console.log(err);
  });

About

Related projects

You might also be interested in these projects:

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Contributors

Commits Contributor
45 jonschlinkert
6 doowb
3 albizures

Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

Author

Jon Schlinkert

License

Copyright © 2017, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.6.0, on December 28, 2017.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].