Axios interceptor middleware (v1.1.1) that automatically encodes request bodies containing files into multipart/form-data using the `form-data` library. Designed as a drop-in interceptor for Axios, it detects streams, buffers, or Blob objects in the request data and converts them to form-data with a random boundary. Key differentiator: simple integration via `axios.interceptors.request.use(axiosFormData)` without modifying existing Axios calls. Stable release, no active cadence reported.
npm install axios-form-dataNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates attaching the axiosFormData interceptor and sending a request with a readable stream that automatically becomes multipart/form-data.
Consider using a more actively maintained alternative like 'form-data' directly or Axios's built-in 'FormData' support in newer versions.
Manually construct FormData for complex structures, or use a library like 'form-data-util'.
Create a new data object or clone the config before passing to the interceptor.
Ensure streams are fresh and at offset 0.
Use `import axiosFormData from 'axios-form-data'` instead of `import { axiosFormData } from 'axios-form-data'`.Run `npm install axios-form-data`.
Call `axios.interceptors.request.use(axiosFormData)` on the same Axios instance used for the request.
Ensure file values are Node.js Readable streams, Buffers, or Blobs.