1.2.0 • Published 8 years ago

acany v1.2.0

Weekly downloads
7
License
MIT
Repository
github
Last release
8 years ago

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.

Thanks for npm~lucasmreis

npm install --save acany

Example:

const acany = require('acany')

const list = [ 'hot coffee', 'chocolate', 'hot coffee with chocolate', 'coffee' ]

found = acany('coffee', list)
// found = [ 'coffee', 'hot coffee', 'hot coffee with chocolate' ]

found = acany('hot coffee', list)
// found = [ 'hot coffee', 'hot coffee with chocolate' ]

found = acany('hot chocolate', list)
// found = [ 'hot coffee with chocolate' ]

Full Example:

// acany(_NEED_, _LIST_, _LIMIT_)

const list = ['aaa', 'yxuu', 'abb', 'xbbc', 'xc', 'xx cc', 'bbc', 'ccc', 'xccc']

found = acany('xc', list)
// found = [ 'xc', 'xccc', 'xbbc', 'xx cc' ]

found = acany('x c', list)
// found = [ 'xbbc', 'xc', 'xx cc', 'xccc' ]

found = acany('x c', list, 2)
// found = [ 'xbbc', 'xc' ]
1.2.0

8 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago