@markitdownjs/api
v0.1.2
Published
HTTP API server for MarkItDownJS document conversion
Readme
@markitdownjs/api
Hono-based HTTP API server for document conversion. Part of MarkItDownJS. Deploy as a standalone microservice or embed in any Node.js app.
Install
npm install @markitdownjs/api @markitdownjs/coreUsage
import { startServer } from "@markitdownjs/api";
startServer({ port: 3000 });Embed in an existing Hono or Node app
import { createApp } from "@markitdownjs/api";
import { MarkItDown } from "@markitdownjs/core";
import { PdfConverter } from "@markitdownjs/pdf";
const parser = new MarkItDown();
parser.registerConverter(new PdfConverter());
const app = createApp({ parser });
// Mount `app` into your existing Hono/Express instanceEndpoints
| Method | Path | Description |
|--------|------|-------------|
| POST | /convert | Convert a single file (multipart/form-data, field: file) |
| POST | /batch | Convert multiple files in one request |
| GET | /health | Health check — returns { status: "ok" } |
| GET | /formats | List registered converter MIME types |
Docker
npx @markitdownjs/cli serve --port 3000API
| Export | Description |
|--------|-------------|
| createApp(opts) | Returns a configured Hono app instance |
| startServer(opts) | Creates the app and starts a Node.js HTTP listener |
