autocomplete-string
v1.0.1 autocomplete string vanilla
autocomplete-string
Pass an array of options and an input string and get a suggestion and a completion string
Install
$ npm install autocomplete-string
Usage
import autocomplete from 'autocomplete-string';
autocomplete('foo', ['hello', 'FoobaR', 'foobaz', 'world']);
/*
{
completion: 'baR',
suggestion: 'Foobar',
suggestionIndex: 1
}
*/
API
autocomplete(input, [list])
Returns the first path found (by respecting the order) or undefined
if none could be found.
input
Type: string
HeyHa
list
Type: array
Foobar
License
MIT © entwicklerstube
npm i autocomplete-string
Metadata
- MIT
- Whatever
- Michael J. Zoidl
- released 5/7/2019