Skip to content

evanlucas/completor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Match input in an array for completions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published