Magic-Words
magic-words is a trie implementation with json and javascript.
usage
add words with addWord and remove them with removeWord methods.
inspect trie
console.log(mw.inspectTrie());
result will be
JSON
your added strings will be stored in json file and it will be loaded everytime you start the script. it will be in node_module/magic-words/data.json. also don't forget to call mw.save() to save your file in disk after you remove or add words.
did you mean?
you can autocomplete added words by calling didyoumean method. it will return array of autocompleted words.