A lightweight TypeScript library extending axios with plugin capabilities (debounce, throttle, merge, retry, cancel, cache, envs, loading) while keeping minimal intrusion (1.37kb core gzipped). Current version 0.6.2, uses peer dependency axios (any version). Designed to provide multiple instance support, low integration cost, and extensibility via IPlugin interface. Alternative to manual interceptor management with richer feature set.
npm install axios-pluginsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating an axios instance, attaching the cache plugin, and making a request that uses caching.
After useAxiosPlugin(request).plugin(...), call .wrap() to obtain a new instance that works with request() as well as axios-specific methods like post().
For multiple axios instances, call useAxiosPlugin(instance) individually.
Use the new sub-path exports: 'axios-plugins/plugins/loading' instead of 'axios-plugins/plugins'.
Ensure all desired plugins are registered in the correct order before making requests.
Chain .wrap() after .plugin() call to obtain the wrapped axios instance.
Update import to specific plugin sub-path: e.g., 'axios-plugins/plugins/loading'.
Use import syntax, or ensure Node.js version supports ESM and set type: module in package.json.