# trie-loader

> Trie loader for Webpack

Latest version **0.10.0** (published 2018-03-07) · MIT license · 0 weekly downloads

## Install

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

## 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.10.0 |
| Published | 2018-03-07 |
| First published | 2018-03-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Joe Nudell |
| Maintainers | jnu |
| Keywords | trie, webpack, loader, tiny-trie |

## Links

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

## Dependencies (1)

- [tiny-trie](https://npm.io/package/tiny-trie.md) ^0.2.0

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.10.0 (latest) — 2018-03-07

## README

trie-loader
===

A Webpack loader for tries. The goal of this loader is to bundle a wordlist
dependency as a trie for efficient transport and lookup. The bundle may be
embedded in the application or stored as an asynchronous chunk, depending on
configuration.

Uses the [tiny-trie](https://github.com/jnu/tiny-tree) for encoding.

## Usage

Take a big list of words (or whatever - all characters are welcome here!)

`wordlist.text`:
```
...
treacle
tree
trie
trill
trim
...
```

Import this wordlist directly into JavaScript. The resultant binding will be
a `PackedTrie` (see [tiny-trie](https://github.com/jnu/tiny-tree)), which
exposes a `lookup` method.

```js
import words from 'trie!./wordlist.txt';

if (words.lookup('trie')) {
    console.log('`trie` is in the dictionary!');
} else {
    console.log('`trie` is not a real word');
}
```

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