autocomplete-trie
v1.0.0
Published
Autocomplete trie impl for node and the browser
Downloads
2
Readme
autocomplete-trie
npm install autocomplete-trie
var Autocomplete = require('autocomplete-trie')
var autocomplete = new Autocomplete([
'aaa',
'aba',
'abc',
'abd',
'aca',
'ada',
'adb',
'acb',
'baa',
'bab',
'bac',
'bad',
'bba',
'bca',
'bdc',
'bda',
'bdb'
]);
console.log(autocomplete.search('a'))
console.log(autocomplete.search('ab'))
console.log(autocomplete.search('abc'))
console.log(autocomplete.search('b'))
console.log(autocomplete.search('ba'))
console.log(autocomplete.search('bac'))
console.log(autocomplete.search('bad'))
Thanks to [email protected] for his original work on the node-autocomplete package.
This package is set to a fork of the original with new code to be shipped and general improvements needed for Minerlabs to utilize the code.
Among first changes are less module cruft, and improved api.