Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

trie-loader

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trie-loader

Trie loader for Webpack

  • 0.10.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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 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), which exposes a lookup method.

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');
}

Keywords

FAQs

Package last updated on 07 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc