autocomplete-string
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

autocomplete-string Build Status

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

/autocomplete-string/

    Package Sidebar

    Install

    npm i autocomplete-string

    Weekly Downloads

    8

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    5.15 kB

    Total Files

    10

    Last publish

    Collaborators

    • michaelzoidl