16 lines
299 B
Markdown
16 lines
299 B
Markdown
```typescript title="WASM"
|
|
import init, { extractFile } from "kreuzberg-wasm";
|
|
|
|
await init();
|
|
|
|
const config = {
|
|
tokenReduction: {
|
|
mode: "moderate",
|
|
preserveImportantWords: true,
|
|
},
|
|
};
|
|
|
|
const result = await extractFile("document.pdf", undefined, config);
|
|
console.log(result.content);
|
|
```
|