Utility library for normalizing axios HTTP responses and errors, version 1.0.2. It standardizes the response structure to match API documentation, abstracting away axios's wrapping of data in a `data` property and handling errors as exceptions. Suitable for projects using axios ^0.27.2. Differentiators: guarantees consistent response shape, distinguishes API errors from network errors, and normalizes errors only from the API server. Release cadence: infrequent (latest 2022). Peer dependency on axios.
npm install axios-normalizerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates using normalizeResponse and normalizeError with an axios instance to handle API responses and errors consistently.
Always chain a second .catch for network errors or use try/catch with async/await.
Pin axios to exactly 0.27.2 or test compatibility before upgrading.
Consider writing custom normalization or using a maintained alternative.
Use named imports: import { normalizeResponse } from 'axios-normalizer';Run: npm install axios-normalizer --save
Ensure normalizeResponse is called with the axios response object: .then(normalizeResponse)