Corpus analysis for Node.js

Read between
the words.

Turn raw text into reliable signals. Exact word frequencies, recurring phrases, lexical statistics, and language-aware views— all in one focused library.

01 / Frequency map sample.txt
language signal meaning patterns text exact context words
01040812
ESM CommonJS Node 20+

Small API. Auditable results. No black box.

Word frequencies N-grams Concordances Lexical statistics 7 language profiles
[ 01 ]

One corpus, many views

See what your text
is really saying.

01 Core analysis

Count with confidence.

Stable rankings, exact maps, and Unicode-aware normalization. Same input, same answer—every time.

02 Language aware

Speak the language.

Built-in profiles respect the alphabet, locale, stop words, and stemming rules of your corpus.

03 Phrase discovery

Find phrases, not just words.

Count bigrams and trigrams across complete strings, incremental chunks, or readable streams.

04 Made for code

Fits your pipeline.

TypeScript declarations, ESM and CommonJS exports, immutable result views, and native stream support.

[ 02 ]

Live playground

Paste text.
Find the signal.

Input / corpus.txt
Output / frequency Complete
Tokens
Types
Diversity
TermFrequencyCount

    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

    Small surface.
    Serious analysis.

    analysis.mjs
    import { analyze } from "freqwords";
    
    const result = analyze(feedback, {
      profile: "english",
      stopWords: true,
      ngramSizes: [2, 3],
    });
    
    console.log(result.entries("filtered", 10));
    MIT licensed TypeScript ready Node.js 20+
    Copied to clipboard