# trie-completer

> A trie-based autocompleter

Latest version **0.0.3** (published 2017-03-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install trie-completer
pnpm add trie-completer
yarn add trie-completer
bun add trie-completer
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2017-03-02 |
| First published | 2017-03-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Zachary Hamm |
| Maintainers | imipolexg |
| Keywords | autocomplete, completion |

## Links

- npm: https://www.npmjs.com/package/trie-completer
- Repository: https://github.com/imipolexg/completer
- Homepage: https://github.com/imipolexg/completer#readme
- Issues: https://github.com/imipolexg/completer/issues
- npm.io page: https://npm.io/package/trie-completer

## Recent versions

- 0.0.3 (latest) — 2017-03-02
- 0.0.2 — 2017-03-02
- 0.0.1 — 2017-03-02

## README

A ternary search trie modified to support autocompletion suggestions.

It's kind of like a binary search tree with lexical ordering. Best case
O(log n) lookups, and space requirements not significantly greater than the
array of completions itself.

Construct with an array of strings:

    const Completer = require('trie-completer');

    let completer = new Completer([
        'a', 'aa', 'aaab', 'abc', 'def'
    ]);

Then you can get the completions for a prefix via `completer.getCompletions(prefix)`
Completions will be sorted in ascending lexical order.

See Sedgewick & Wayne, Algorithms, 4th edition, Section 5.2

---
_Source: https://npm.io/package/trie-completer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
