trie-hard

A JavaScript trie implementation for Node.js and the browser

MainAPIExample Code

trie-hard is a JavaScript implementation of the trie data structure; it works in Node and in the browser. Its search API returns information about full word matches as well as prefix matches.

Demo

This demo shows the internal representation of a trie with a matchCharacter value of "_" instead of the default null character.

Add a new word to the trie:

Test for the existance of a word in the trie: