faressoft / Inquirer Checkbox Plus Prompt
Licence: mit
Checkbox with autocomplete and other additions for Inquirer
Stars: ✭ 25
Programming Languages
javascript
184084 projects - #8 most used programming language
Projects that are alternatives of or similar to Inquirer Checkbox Plus Prompt
Deno Cliffy
Command line framework for deno 🦕 Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Stars: ✭ 149 (+496%)
Mutual labels: cli, command-line, prompt
Terjira
Terjira is a very interactive and easy to use CLI tool for Jira.
Stars: ✭ 713 (+2752%)
Mutual labels: cli, command-line, prompt
Node Promptly
Simple command line prompting utility for nodejs
Stars: ✭ 140 (+460%)
Mutual labels: cli, command-line, prompt
Sharprompt
Interactive command line interface toolkit for C#
Stars: ✭ 197 (+688%)
Mutual labels: cli, command-line, prompt
Prompts
❯ Lightweight, beautiful and user-friendly interactive prompts
Stars: ✭ 6,970 (+27780%)
Mutual labels: cli, command-line, prompt
Go Prompt
Building powerful interactive prompts in Go, inspired by python-prompt-toolkit.
Stars: ✭ 4,255 (+16920%)
Mutual labels: cli, command-line, prompt
Survey
A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
Stars: ✭ 2,843 (+11272%)
Mutual labels: cli, command-line, prompt
Xonsh
🐚 Python-powered, cross-platform, Unix-gazing shell
Stars: ✭ 5,327 (+21208%)
Mutual labels: cli, command-line, prompt
Clifx
Declarative framework for building command line interfaces
Stars: ✭ 900 (+3500%)
Mutual labels: cli, command-line
Ripgrep
ripgrep recursively searches directories for a regex pattern while respecting your gitignore
Stars: ✭ 28,564 (+114156%)
Mutual labels: cli, command-line
Clipp
easy to use, powerful & expressive command line argument parsing for modern C++ / single header / usage & doc generation
Stars: ✭ 687 (+2648%)
Mutual labels: cli, command-line
Svgexport
SVG to PNG/JPEG command-line tool and Node.js module
Stars: ✭ 731 (+2824%)
Mutual labels: cli, command-line
Mow.cli
A versatile library for building CLI applications in Go
Stars: ✭ 725 (+2800%)
Mutual labels: cli, command-line
Mprislyrics
Small command-line utility that displays lyrics in sync with the currently playing song in a MPRIS2 capable player.
Stars: ✭ 24 (-4%)
Mutual labels: cli, command-line
Js Liftoff
Launch your command line tool with ease.
Stars: ✭ 761 (+2944%)
Mutual labels: cli, command-line
Inquirer Checkbox Plus Prompt
A plugin for Inquirer, similar to the original checkbox with extra features.
Installation
npm install -g inquirer-checkbox-plus-prompt
Usage
You can name it with any name other than checkbox-plus
, just change the string 'checkbox-plus'
to anything else.
inquirer.registerPrompt('checkbox-plus', require('inquirer-checkbox-plus-prompt'));
inquirer.prompt({
type: 'checkbox-plus',
...
})
Options
Takes type
, name
, message
, source
[, filter
, validate
, default
, pageSize
, highlight
, searchable
] properties.
The extra options that this plugin provides are:
-
source: (Function) a method that called to return a promise that should be resolved with a list of choices in a similar format as the
choices
option in the originalcheckbox
prompt ofInquirer
. -
highlight: (Boolean) if
true
, the current selected choice gets highlighted. Default:false
. -
searchable: (Boolean) if
true
, allow the user to filter the list. Thesource
function gets called everytime the search query is changed. Default:false
.
Example
Check example.js for a more advanced example.
var inquirer = require('inquirer');
var fuzzy = require('fuzzy');
inquirer.registerPrompt('checkbox-plus', require('./index'));
var colors = ['red', 'green', 'blue', 'yellow'];
inquirer.prompt([{
type: 'checkbox-plus',
name: 'colors',
message: 'Enter colors',
pageSize: 10,
highlight: true,
searchable: true,
default: ['yellow', 'red'],
source: function(answersSoFar, input) {
input = input || '';
return new Promise(function(resolve) {
var fuzzyResult = fuzzy.filter(input, colors);
var data = fuzzyResult.map(function(element) {
return element.original;
});
resolve(data);
});
}
}]).then(function(answers) {
console.log(answers.colors);
});
License
This project is under the MIT license.
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].