Skip to content

Choose an API and entry ​

Start with the default matcher, then opt into the capabilities your task needs.

Choose by task ​

TaskStart here
Find every rangesearch / iterate
Check presence or countmatch / count / countByPattern
Replace or highlightreplace / tokenize
Normalize complete strings/text
Fold case, including streams/unicode
Edit dictionaries/dynamic
Process chunks/stream

Pick an entry ​

EntryExportsPurpose
modern-ahocorasickdefault constructor; named typesExact matching, boundaries, four selection strategies, tokenization
/textdefault TextMatcherExisting whole-text normalization and case folding
/unicodedefault constructorUnicode 17.0 full case folding
/fastdefault constructorOptional double-array trie
/unicode-fastdefault constructorFull folding with the double-array trie
/dynamicdefault DynamicDictionary; snapshot/compiler typesBatched edits and immutable compiled snapshots
/replacekeep, remove, mask, fromMap, onceLiteral replacement callbacks
/streammatch/token/replace sessions and iterable adaptersIncremental Unicode processing
/stream/filtersurls, markdown, protectedTextProtect supported syntax from matching
/stream/node, /stream/webcreateMatchTransform, createTokenTransform, createReplaceTransformPlatform stream adapters

Paths in this table are package subpaths, not additional packages. Internal tables and shared implementation chunks are not public entry points. Importing the default entry does not load the folding table, double-array compiler or Node stream modules.

Version and environment ​

This site documents published v3.2.0. Core flat ranges arrived in v3.0; whole-word queries, persistence, countByPattern, core streams and /text in v3.1; character boundaries, longest-first, tokenization, range queries, statistics and the other optional entries in v3.2. All entries support ESM and CommonJS with no runtime dependencies. Class entries return the constructor directly from require().

See Installation and runtime requirements.

MIT · Based on BrunoRB/ahocorasick