Axios middleware that automatically transforms object keys between snake_case and camelCase in HTTP requests and responses. Current stable version is 1.1.1. It uses Axios interceptors to convert outgoing request data, params, and headers to snake_case/Header-Case, and incoming response data and headers back to camelCase. Built on top of the 'change-case' library. Requires Axios >=1.0.0 as a peer dependency. Differentiates from similar libraries by also handling URL params and headers, and offering fine-grained options like preservedKeys, ignoreHeaders, and caseFunctions for overriding transformation behavior. Ships TypeScript declarations.
npm install axios-case-converterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an Axios instance with automatic camelCase/snake_case conversion for requests and responses.
Upgrade axios to version >=1.0.0 and <2.0.0.
Polyfill only if targeting IE. For modern browsers, no action needed.
Check against snake_case strings when using preservedKeys as a function.
Set ignoreHeaders: true if you need to preserve header casing.
Override caseOptions.stripRegexp to match standard change-case behavior if needed.
Use: import applyCaseMiddleware from 'axios-case-converter'
Run: npm install axios