Overview of the different chunkers available in Chonkie TS
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.
All chunkers in Chonkie TS share a consistent, async interface:
Copy
Ask AI
// Import and create a chunker instance (async)const chunker = await TokenChunker.create({ chunkSize: 256 });// Chunk a single stringconst chunks = await chunker("Some text to chunk!");// Or chunk a batch of textsconst 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]).