trie-prefix

A simple trie index implementation that includes case sensitivity

Usage no npm install needed!

<script type="module">
  import triePrefix from 'https://cdn.skypack.dev/trie-prefix';
</script>

README

trie-prefix

A modification/simplification of lyndseybrowning/trie-prefix-tree. Includes case-sensitivity.

Usage

Installation

npm install trie-prefix

Usage Example

const trie = require('trie-prefix')

const input = 'The Quick Brown Fox Jumped Over the Lazy Dog'.split(' ')
const isCaseSensitive = true

const index = (input, isCaseSensitive)

API

index.getPrefix(prefixString)

Gets all results that start with the prefix string.

index.tree()

Gets the raw trie object.

License

The MIT License (MIT) | 2019 Arjun Mehta