curl2ts 🔒 100% client-side

cURL to TypeScript Fetch

Generate a typed native fetch() client for Next.js, Node 18+, Bun, Deno and the browser.

cURL command

Native fetch, fully typed

The generated function builds the URL with URL / searchParams, throws on non-2xx responses, and returns Promise<TResponse>. No dependencies required.

Why curl2ts?

Supported cURL flags

-X / --request, -H / --header, -d / --data / --data-raw / --data-binary, --json, -u / --user, -b / --cookie, --url, plus single, double and $'…' quoting and \ line continuations (Chrome / Firefox "Copy as cURL" works).