Chonkie TS provides multiple chunking strategies to handle different text processing needs in JavaScript and TypeScript environments. Each chunker is designed to be easy to use, fast, and consistent with the core principles outlined in the concepts page.

Availability

The following chunkers are currently available in Chonkie TS:

ChunkerAvailable
TokenChunker✅
SentenceChunker✅
RecursiveChunker✅

Common Interface

All chunkers in Chonkie TS share a consistent, async interface:

// Import and create a chunker instance (async)
const chunker = await TokenChunker.create({ chunkSize: 256 });

// Chunk a single string
const chunks = await chunker("Some text to chunk!");

// Or chunk a batch of texts
const batchChunks = await chunker(["Text 1", "Text 2"]);

All chunkers are directly callable as async functions after creation: await chunker(text) or await chunker([text1, text2]).

F.A.Q.