Match input in an array for completions.
Say you want to get possible completions for a given string, str.
With completor
, all you have to do is call completor(str, array)
.
$ npm install completor
const completor = require('completor')
const input = [
'brad'
, 'dan'
, 'Donald'
, 'Bradley'
, 'evan'
]
completor('br', input)
// => ['brad', 'Bradley']
// can also do
completor.insensitive('br', input)
// => ['brad', 'Bradley']
// or go case sensitive
completor('br', input, true)
// => ['brad']
// can also do
completor.sensitive('br', input)
// => ['brad']
$ npm test
Evan Lucas
MIT (See LICENSE
for more info)