AW CurlCraft icon CurlCraft
Launch

CurlCraft Documentation

CurlCraft is a developer utility for bridging the gap between terminal-based cURL commands and modern JavaScript network requests. It parses complex cURL strings into structured Fetch or Axios code blocks instantly. Launch CurlCraft.

Supported Converters

CurlCraft doesn't just do a blind text swap. It understands the underlying request structure and provides optimized code for:

  • Native Fetch: Modern, dependency-free browser code.
  • Axios: Clean, promise-based requests with dedicated config objects.
  • TypeScript: Strongly-typed request patterns with interface suggestions.
  • Explain Mode: A plain-English breakdown of what the cURL command is actually doing.

Conversion Options

Tailor the generated output to your project's coding style:

  • Runtime Toggle: Switch between Browser (standard APIs) and Node.js (using packages like node-fetch).
  • Syntax Style: Choose between modern async/await or legacy .then() promise chains.
  • Error Handling: Automatically wraps code in try/catch blocks with status check logic.
  • Timeout Injection: Adds AbortController logic to native fetch to prevent hanging requests.

Security & Privacy

Network requests often contain sensitive data like Bearer tokens, API keys, and session cookies. CurlCraft protects this data in two ways:

  1. Local Execution: The regex parsing engine runs entirely in your browser's JavaScript VM. No data is sent to a backend API.
  2. Secret Masking: If enabled, CurlCraft automatically redacts known sensitive patterns (e.g., Authorization: Bearer ***) in the UI, allowing you to debug logic without exposing your live credentials.

Common Use Cases

// Example: Converting a Postman snippet to Fetch curl -X POST https://api.acme.com/v1/orders -H "Content-Type: application/json" -d {"id": 123}

CurlCraft is ideal for:

  • Migrating legacy curl shell scripts to a new Node.js microservice.
  • Testing API documentation examples directly in your frontend application.
  • Quickly generating boilerplate for complex multipart/form-data uploads.

Frequently Asked Questions

Does it support cookies (-b/--cookie)?
Yes. It parses cookie flags, though note that browser requests are subject to withCredentials and CORS policies which cURL ignores.

Can I use it for GraphQL?
Absolutely. If you paste a cURL command containing a JSON body with a query field, CurlCraft will correctly format the payload for your JS request.

Stop writing boilerplate

Use CurlCraft to turn CLI commands into production code in milliseconds.

Launch CurlCraft