0.0.1 • Published 5 months ago
chunkr-ai v0.0.1
Chunkr AI Node.js Client
Official Node.js client for the Chunkr API - A powerful document processing and chunking service for RAG applications.
Features
- 📄 Process documents (PDF, Word, etc.)
- 🔍 OCR support with configurable strategies
- 📊 Layout analysis and intelligent segmentation
- 🔄 Async task management with polling
- 📝 Multiple output formats (HTML, Markdown, JSON)
- 🛠️ Configurable processing options
Installation
npm install chunkr-ai
Quick Start
import { Chunkr } from "chunkr-ai";
// Initialize client with API key
const chunkr = new Chunkr("your-api-key");
// Process a document
const task = await chunkr.upload("path/to/document.pdf");
// Access the processed content
console.log(task.getHtml()); // Get HTML output
console.log(task.getMarkdown()); // Get Markdown output
console.log(task.output); // Get full structured output
Authentication
You can provide your API key in several ways:
// 1. Direct initialization
const chunkr = new Chunkr("your-api-key");
// 2. Environment variable
// Set CHUNKR_API_KEY in your environment or .env file
const chunkr = new Chunkr();
// 3. Configuration object
const chunkr = new Chunkr({
apiKey: "your-api-key",
baseUrl: "https://api.chunkr.ai", // Optional custom API URL for version control
});