1.0.0 • Published 8 years ago

completor v1.0.0

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

completor

Build Status Coverage Status

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)