acany : simple support to autocomplete. receve a list and a word
return a list math in sort of less diff, but this not sort your initial list
I will help if you have any difficulty =)
Contact me by github:heyderpd. I'll be glad to help you.
npm install --save acany
Example:
const acany = require('acany')
const list = [ 'hot coffee', 'chocolate', 'hot coffee with chocolate', 'coffee' ]
found = acany('coffee', list)
found = acany('hot coffee', list)
found = acany('hot chocolate', list)
Full Example:
const list = ['aaa', 'yxuu', 'abb', 'xbbc', 'xc', 'xx cc', 'bbc', 'ccc', 'xccc']
found = acany('xc', list)
found = acany('x c', list)
found = acany('x c', list, 2)