chowbea-axios
v1.0.5
Published
Type-safe axios client that makes api requests a breeze
Downloads
60
Maintainers
Readme
Quick Start
# Initialize and configure
npx chowbea-axios init
# Fetch spec and generate client
npx chowbea-axios fetchThen import and use:
import { api } from "./services/api/api.client";
const { data, error } = await api.op.getUserById({ id: "123" });
if (error) return console.error(error.message);
console.log(data.name); // ✨ Fully typedWhy chowbea-axios?
- Zero manual types — Generated directly from your OpenAPI spec
- Full autocomplete — Every endpoint, parameter, and response
- Result-based errors —
{ data, error }instead of try/catch - Watch mode — Auto-regenerate when your spec changes
What Gets Generated
services/api/
├── _generated/
│ ├── api.types.ts # All TypeScript types
│ └── api.operations.ts # Typed operation methods
├── api.client.ts # Your API client (editable)
├── api.instance.ts # Axios instance (editable)
└── api.helpers.ts # Type helpers (editable)Commands
| Command | Description |
| ------- | ----------- |
| init | Interactive setup — creates config and base files |
| fetch | Fetch spec from endpoint and generate types |
| generate | Generate from cached/local spec |
| watch | Watch for spec changes and auto-regenerate |
| status | Show current config and cache status |
| validate | Validate your OpenAPI spec |
| diff | Compare specs and show changes |
⭐ Support
If chowbea-axios helps you ship faster, consider giving it a star! It helps others discover the project and motivates continued development.
License
MIT
