completor
v1.0.0
Published
Match input in an array for completions
Downloads
3
Readme
completor
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)
.
Install
$ npm install completor
Usage
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']
Test
$ npm test
Author
Evan Lucas
License
MIT (See LICENSE
for more info)