Skip to content

bredele/array-prefix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

array-prefix

NPM Downloads

Filter list of words prefixed with given string (ideal for autocompletion)

Usage

import find from 'array-prefix'

prefix('he', ['hello', 'hector', 'hell', 'world', 'worm'])
// => ['hello', 'hector', 'hell']

// sort output
prefix('he', ['hello', 'hector', 'hell', 'world', 'worm'], true)
// => ['hector', 'hell', 'hello']

Installation

npm install array-prefix

About

Lookup list of words starting with given string (ideal for autocompletion)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published