{"_id":"triesearch","_rev":"5-f7bb1b345e44727556c107b119fb88ae","name":"triesearch","description":"An in-memory node.js autocomplete package based on the trie data structure, based off the autocomplete module","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"triesearch","description":"An in-memory node.js autocomplete package based on the trie data structure, based off the autocomplete module","keywords":["autocomplete","trie","complete","auto-complete","completion","search"],"version":"1.0.0","author":{"name":"fed135"},"main":"index","dependencies":{},"devDependencies":{"mocha":"2.4.x","should":"8.3.x"},"scripts":{"test":"mocha test/"},"repository":{"type":"git","url":"git://github.com/nisaacson/triecomplete.git"},"license":"GPLv3","gitHead":"d2ab5fd2831adc190aa138c12f0efb077f54ce72","bugs":{"url":"https://github.com/nisaacson/triecomplete/issues"},"homepage":"https://github.com/nisaacson/triecomplete#readme","_id":"triesearch@1.0.0","_shasum":"819e66c9109ace596b19023b725fc64d4e99faa1","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.9.1","_npmUser":{"name":"fed135","email":"fredericcharette@gmail.com"},"dist":{"shasum":"819e66c9109ace596b19023b725fc64d4e99faa1","tarball":"https://registry.npmjs.org/triesearch/-/triesearch-1.0.0.tgz","integrity":"sha512-EoUSeB8jjHZSDkFHd+87PeH5nLNHyhF5yps/77Cf70RAZehgpD2GwNwTXQbHbkP6Jt7RugP/7kAjDHvMfqFO7g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQ4NTfJL6leVxxaPQX3j/+UDQ7Df2DOVsnlDU0YbNgpgIhAL/nlSDaulIsF+JTMXe3QcxzhhG08wwIEIk2lJ9nOvwv"}]},"maintainers":[{"name":"fed135","email":"fredericcharette@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/triesearch-1.0.0.tgz_1461020850822_0.3413484871853143"}},"1.0.1":{"name":"triesearch","description":"An in-memory node.js autocomplete package based on the trie data structure, based off the autocomplete module","keywords":["autocomplete","trie","complete","auto-complete","completion","search"],"version":"1.0.1","author":{"name":"fed135"},"main":"index","dependencies":{},"devDependencies":{"mocha":"2.4.x","should":"8.3.x"},"scripts":{"test":"mocha test/"},"repository":{"type":"git","url":"git://github.com/nisaacson/triecomplete.git"},"license":"GPLv3","gitHead":"f644829943bf5bd975feabe75ce87457b64ed0c4","bugs":{"url":"https://github.com/nisaacson/triecomplete/issues"},"homepage":"https://github.com/nisaacson/triecomplete#readme","_id":"triesearch@1.0.1","_shasum":"8eed3bda401389c99ea14f24ff12a2e06109d553","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.9.1","_npmUser":{"name":"fed135","email":"fredericcharette@gmail.com"},"dist":{"shasum":"8eed3bda401389c99ea14f24ff12a2e06109d553","tarball":"https://registry.npmjs.org/triesearch/-/triesearch-1.0.1.tgz","integrity":"sha512-8IWDxtyzMcuPpsWHKf9P++tTe52KXGG7dVD9sSCOq35TJqnxyo3h0DedpJR6Yjys6ffF8NrF1tEPj7Sk/a98Bg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3Qr44MrB8xQrSjDI5lwofFiqm31igq3hLV/bCj71grwIgRqhD8oMMQ7e4CrWQ+PQqhv2/7YFnMpSI18MEPrjcVsQ="}]},"maintainers":[{"name":"fed135","email":"fredericcharette@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/triesearch-1.0.1.tgz_1461075835998_0.9357508250977844"}},"1.0.2":{"name":"triesearch","description":"An in-memory node.js autocomplete package based on the trie data structure, based off the autocomplete module","keywords":["autocomplete","trie","complete","auto-complete","completion","search"],"version":"1.0.2","author":{"name":"fed135"},"main":"index","dependencies":{},"devDependencies":{"mocha":"2.4.x","should":"8.3.x"},"scripts":{"test":"mocha test/"},"repository":{"type":"git","url":"git://github.com/nisaacson/triecomplete.git"},"license":"GPLv3","gitHead":"50b873218c2b0f2548c4f942cdc2ec25dace1de1","bugs":{"url":"https://github.com/nisaacson/triecomplete/issues"},"homepage":"https://github.com/nisaacson/triecomplete#readme","_id":"triesearch@1.0.2","_shasum":"7d99c1bb2a0965618a1ac1ec82f5ef7c868ed7ed","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"fed135","email":"fredericcharette@gmail.com"},"dist":{"shasum":"7d99c1bb2a0965618a1ac1ec82f5ef7c868ed7ed","tarball":"https://registry.npmjs.org/triesearch/-/triesearch-1.0.2.tgz","integrity":"sha512-6U/LlquLcPVjzH6CEV2+arlNRSpT8Pg98w3CRIgsGQMHQGJ8CoG70IcTV2QZIjUg07578TubQiQaGVidr2xoYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICe0A6wi4DqhZj0w1rsiJVHjahW2WUOGT5dkIakdDlcNAiABR/oQ6SYGgiuNglNfsTu6dKxB/VQRyiIouvAcv6BHqw=="}]},"maintainers":[{"name":"fed135","email":"fredericcharette@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/triesearch-1.0.2.tgz_1461332782233_0.7832453779410571"}}},"readme":"# Node Autocomplete\n\nModernized Trie-search based on [Node Autocomplete](https://www.github.com/marccampbell/node-autocomplete) is an autocomplete library for [node.js](http://nodejs.org).\n\n**TODO**: Cleanup test suite, use chai. Add all them missing semi-colons...\n\n## Installation\n\n```bash\nnpm install triesearch\n```\n\n## Features\n\n  - in memory, in process, not redis dependent\n  - internal [trie](http://en.wikipedia.org/wiki/Trie) data structure to store the strings\n  - super fast for adding, removing and lookups\n  - performance tested for string lists of 500,000 words\n  - high level of tests\n\n\n## Usage\n\n```javascript\nvar data = ['fruit', 'app', 'apple', 'banana']\n// instatiate a new autocomplete object\nvar Autocomplete = require('autocomplete')\nvar auto = new Autocomplete()\nauto.initialize(data)\n// results will be an array with 0 or more elements\nvar results = auto.search('ap')\n\n// here results will be an array of key-value pairs\nconsole.dir(results)\n```\n\n## Output\nThe output of the search is an array of objects with key and value properties. In the example above, `results` looks like\n```javascript\n[\n  {\n    key: 'app',\n    value: 'app'\n  },\n  {\n    key: 'apple',\n    value: 'apple',\n  }\n]\n```\n\nIf you are just searching for strings you can get an array of matching strings by mapping the results and returning just the key\n```javascript\nvar data = ['fruit', 'app', 'apple', 'banana']\n// instatiate a new autocomplete object\nvar Autocomplete = require('autocomplete')\nvar auto = new Autocomplete()\nauto.initialize(data)\n// results will be an array with 0 or more elements\nvar results = auto.search('ap')\n\n// here results will be an array of key-value pairs\nconsole.dir(results)\nvar stringMatches = results.map(function (result) {\n  return result.key\n})\n// stringMatches is ['app', 'apple']\nconsole.dir(stringMatches)\n```\n\n\n## Adding\nYou can add to the list of candidate elements after the autocomplete object has been initialized\n```javascript\nvar Autocomplete = require('autocomplete')\nvar auto = new Autocomplete()\nvar data = []\nauto.initialize(data)\nauto.addElement('cheeseburger')\n```\n\n## Removing\nYou can remove from the list of candidate elements after the autocomplete object has been initialized\n```javascript\nvar Autocomplete = require('autocomplete')\nvar auto = new Autocomplete()\nvar data = ['app', 'apple', 'apples']\nauto.initialize(data)\nauto.removeElement('apple')\n```\n\n## Object Elements\nYou can also add key value pairs as an array of 2 elements\n\n```javascript\nvar Autocomplete = require('autocomplete')\nvar auto = new Autocomplete()\nvar data = ['app', 'apple', ['apples', 'yummy'], 'banana' ]\nauto.initialize(data)\nvar results = app.search('ap')\n// in the results, there will be an element with the key *apples* and the value *yummy*\nconsole.dir(results)\n```\n\nIn the example above, `results` looks like\n\n```javascript\n[\n  { key: 'app', value: 'app' },\n  { key: 'apple', value: 'apple' },\n  { key: 'apples', value: 'yummy' }\n]\n```\n## Running Tests\n\nInstall development dependencies:\n\n```bash\nnpm install\n```\n\nThen:\n\n```bash\nnpm test\n```\n\nActively tested with node:\n\n  - 0.8.22\n\n## Authors\n\n  * Noah Isaacson\n  * Marc Campbell\n\nOriginal source code based on [https://github.com/marccampbell/node-autocomplete](https://github.com/marccampbell/node-autocomplete)\n## License\n\n(The MIT License)\n\nCopyright (c) 2011 Marc Campbell &lt;marc.e.campbell@gmail.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","maintainers":[{"name":"fed135","email":"fredericcharette@gmail.com"}],"time":{"modified":"2022-06-27T21:18:52.331Z","created":"2016-04-18T23:07:32.231Z","1.0.0":"2016-04-18T23:07:32.231Z","1.0.1":"2016-04-19T14:23:57.565Z","1.0.2":"2016-04-22T13:46:25.159Z"},"homepage":"https://github.com/nisaacson/triecomplete#readme","keywords":["autocomplete","trie","complete","auto-complete","completion","search"],"repository":{"type":"git","url":"git://github.com/nisaacson/triecomplete.git"},"author":{"name":"fed135"},"bugs":{"url":"https://github.com/nisaacson/triecomplete/issues"},"license":"GPLv3","readmeFilename":"README.md"}