Count with confidence.
Stable rankings, exact maps, and Unicode-aware normalization. Same input, same answer—every time.
Turn raw text into reliable signals. Exact word frequencies, recurring phrases, lexical statistics, and language-aware views— all in one focused library.
Small API. Auditable results. No black box.
One corpus, many views
Stable rankings, exact maps, and Unicode-aware normalization. Same input, same answer—every time.
Built-in profiles respect the alphabet, locale, stop words, and stemming rules of your corpus.
Count bigrams and trigrams across complete strings, incremental chunks, or readable streams.
TypeScript declarations, ESM and CommonJS exports, immutable result views, and native stream support.
Live playground
This browser demo mirrors core counting behavior. The package adds streams, concordances, stemming, n-grams, and exact result views.
Zero to insight in three lines
import { analyze } from "freqwords";
const result = analyze(feedback, {
profile: "english",
stopWords: true,
ngramSizes: [2, 3],
});
console.log(result.entries("filtered", 10));