All Projects → mokkabonna → Inquirer Autocomplete Prompt

mokkabonna / Inquirer Autocomplete Prompt

Licence: isc
Autocomplete prompt for inquirer

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Inquirer Autocomplete Prompt

Vim You Autocorrect
Why should smartphones get all the fun?
Stars: ✭ 173 (-30.8%)
Mutual labels:  autocomplete
Heyui
🎉UI Toolkit for Web, Vue2.0 http://www.heyui.top
Stars: ✭ 2,373 (+849.2%)
Mutual labels:  autocomplete
Massautocomplete
Auto Complete for Angularjs applications with a lot to complete
Stars: ✭ 231 (-7.6%)
Mutual labels:  autocomplete
Autosuggest Highlight
Utilities for highlighting text in autosuggest and autocomplete components
Stars: ✭ 176 (-29.6%)
Mutual labels:  autocomplete
Clojurevscode
Clojure support for Visual Studio Code
Stars: ✭ 204 (-18.4%)
Mutual labels:  autocomplete
Wpf Autocomplete Textbox
An autocomplete TextBox for WPF
Stars: ✭ 210 (-16%)
Mutual labels:  autocomplete
Angular Search Experience
Algolia + Angular = 🔥🔥🔥
Stars: ✭ 167 (-33.2%)
Mutual labels:  autocomplete
Academic Phrases
Bypass that mental block when writing your papers.
Stars: ✭ 244 (-2.4%)
Mutual labels:  autocomplete
Company Sourcekit
Completion for Swift projects via SourceKit with the help of SourceKitten
Stars: ✭ 203 (-18.8%)
Mutual labels:  autocomplete
Vue2 Autocomplete
Vue 2 Component to make Autocomplete element.
Stars: ✭ 227 (-9.2%)
Mutual labels:  autocomplete
Jxa
JavaScript for Automation(JXA) packages for TypeScript/Node.js.
Stars: ✭ 183 (-26.8%)
Mutual labels:  autocomplete
Vue Cool Select
Select with autocomplete, slots, bootstrap and material design themes.
Stars: ✭ 195 (-22%)
Mutual labels:  autocomplete
Intelephense
Intellisense for PHP
Stars: ✭ 212 (-15.2%)
Mutual labels:  autocomplete
Airbnb Android Google Map View
This is a sample Android Application which has Google Map view similar to what AirBnb Android Application. Moving Markers like Uber/Ola. Custom Google Search for places. Recycler view with Animations added.
Stars: ✭ 175 (-30%)
Mutual labels:  autocomplete
Ng Select
⭐ Native angular select component
Stars: ✭ 2,781 (+1012.4%)
Mutual labels:  autocomplete
Modernsearchbar
The famous iOS search bar with auto completion feature implemented.
Stars: ✭ 167 (-33.2%)
Mutual labels:  autocomplete
Punchkeyboard
Punchkeyboard is an open-source keyboard for virtual reality, enhanced with autocomplete and next word prediction functionality for a swift typing experience.
Stars: ✭ 208 (-16.8%)
Mutual labels:  autocomplete
Openautocomplete
OpenAutoComplete -- CLI autocomplete specification
Stars: ✭ 249 (-0.4%)
Mutual labels:  autocomplete
Autocomplete
Blazing fast and lightweight autocomplete widget without dependencies. Only 1KB gzipped. Demo:
Stars: ✭ 244 (-2.4%)
Mutual labels:  autocomplete
Lua Lsp
A Lua language server
Stars: ✭ 219 (-12.4%)
Mutual labels:  autocomplete

inquirer-autocomplete-prompt

Greenkeeper badge

Autocomplete prompt for inquirer

build status

Installation

npm install --save inquirer-autocomplete-prompt

Usage

This prompt is anonymous, meaning you can register this prompt with the type name you please:

inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt'));
inquirer.prompt({
  type: 'autocomplete',
  ...
})

Change autocomplete to whatever you might prefer.

Options

Note: allowed options written inside square brackets ([]) are optional. Others are required.

type, name, message, source[, default, pageSize, filter, when, suggestOnly, validate, searchText, emptyText]

See inquirer readme for meaning of all except source, suggestOnly, searchText and emptyText.

source will be called with previous answers object and the current user input each time the user types, it must return a promise.

source will be called once at at first before the user types anything with undefined as the value. If a new search is triggered by user input it maintains the correct order, meaning that if the first call completes after the second starts, the results of the first call are never displayed.

suggestOnly is default false. Setting it to true turns the input into a normal text input. Meaning that pressing enter selects whatever value you currently have. And pressing tab autocompletes the currently selected value in the list. This way you can accept manual input instead of forcing a selection from the list.

validate is called with the entered text when suggestOnly is set to true. When suggestOnly is false, validate is called with the choice object. In addition it is called with the answers object so far.

searchText Is the text shown when searching. Defaults: Searching...

emptyText Is the text shown if the search returns no results. Defaults: No results...

Example

inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt'));
inquirer.prompt([{
  type: 'autocomplete',
  name: 'from',
  message: 'Select a state to travel from',
  source: function(answersSoFar, input) {
    return myApi.searchStates(input);
  }
}]).then(function(answers) {
  //etc
});

See also example.js for a working example.

I recommend using this package with fuzzy if you want fuzzy search. Again, see the example for a demonstration of this.

Autocomplete prompt

Credits

Martin Hansen

License

ISC

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].