Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md
LiteParse Cloudflare Worker
A starter template for deploying LiteParse on Cloudflare Workers to parse PDFs at the edge using WebAssembly.
Overview
This Worker runs LiteParse's Rust/WASM parser directly on Cloudflare's edge runtime, letting you extract text from PDFs without managing servers or containers.
Prerequisites
- Node.js 18+
- Wrangler CLI logged in (
npx wrangler login)
Getting Started
# Install dependencies
npm install
# Start local dev server
npm run devUsage
Send a PDF as the request body:
curl -X POST --data-binary @document.pdf http://localhost:8787Response:
{
"text": "Extracted text content...",
"pages": 12
}Deploy
npm run deployProject Structure
| File | Description |
|---|---|
src/index.ts | Worker entrypoint — accepts PDF bytes, runs WASM parser, returns JSON |
liteparse_wasm_bg.wasm | Compiled LiteParse WebAssembly module |
wrangler.jsonc | Cloudflare Workers configuration with CompiledWasm rule |
How It Works
- The
.wasmfile is bundled via Wrangler'sCompiledWasmrule. initSync()initializes the WASM module on the first request.LiteParseparses the PDF bytes and returns structured text.
License
MIT