Registry / devops / axios-master

axios-master

JSON →
library2.0.8jsnpmunverified

Axios wrapper (v2.0.8) that extends Axios with automatic retry on configurable HTTP status codes, token refresh via callback, and structured request/response logging with timing metadata. Ships TypeScript declarations. Retry is limited to one attempt per status match. Alternatives like axios-retry offer more retry customization but lack integrated token refresh and logging. Suitable for microservice clients and SDKs. Maintained by a single developer; release frequency is low.

npm install axios-master
INSTALL
IMPORT
SIG · AXIOS-MASTER
A
axios-master
devopsjavascriptv2.0.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (axiosMaster)
import axiosMaster from 'axios-master';
Supports both ESM and CJS. TypeScript types included.
MasterConfig
import type { MasterConfig } from 'axios-master';
import { MasterConfig } from 'axios-master';
Type import only; MasterConfig is not a runtime export.
LogData
import type { LogData } from 'axios-master';
const { LogData } = require('axios-master');
LogData is an interface; use type import.

Demonstrates axios-master with retry, token refresh, and custom logger.

import axiosMaster from 'axios-master'; import type { MasterConfig } from 'axios-master'; async function getData() { const config: MasterConfig = { name: 'Fetch Example', timeout: 10000, shouldRetry: true, shouldRetryStatus: [401, 500], retryFunction: async () => { // token refresh logic return 'new-token'; }, logger: (log) => console.log(log.message), }; const result = await axiosMaster( { method: 'GET', url: 'https://api.example.com/data', headers: { Authorization: `Bearer ${process.env.API_KEY ?? ''}`, }, }, config ); console.log(result); } getData().catch(console.error);
Debug
Known issues
breakingRetry fires only once per matching status code; infinite retry loops prevented.
fix
If you need multiple retries, wrap the call in your own retry loop.
affects: >=2.0.0
breakingThe function expects exactly two arguments: AxiosRequestConfig and MasterConfig. No currying.
fix
Always provide both arguments.
affects: >=2.0.0
gotchaIf shouldRetry is true but shouldRetryStatus is empty, no retry occurs.
fix
Set shouldRetryStatus to at least one status code.
affects: >=2.0.0
gotchaThe module does not export AxiosInstance or create() methods; it only exports the default function.
fix
Use default import for the request function.
affects: >=2.0.0
deprecatedThe log boolean flag in MasterConfig may be removed; use logger callback instead.
fix
Replace log: true with a logger callback to avoid future breakage.
affects: >=1.5.0
Errors
Common errors & fixes
Cannot find module 'axios-master' or its corresponding type declarations.
axios-master not installed or TS cannot resolve types.
fix
npm install axios-master && ensure tsconfig.json includes node_modules types ("compilerOptions": { "types": ["node"] }).
TypeError: axiosMaster is not a function
Incorrect import in a CommonJS environment (using named import instead of default).
fix
Use const axiosMaster = require('axios-master').default or import axiosMaster from 'axios-master'.
Property 'shouldRetry' does not exist on type 'MasterConfig'
Outdated TypeScript definitions; need to update to version 2.0.8.
fix
npm install axios-master@latest
Request failed with status 403 and no retry attempted
403 not in shouldRetryStatus array.
fix
Add 403 to shouldRetryStatus: shouldRetryStatus: [401, 403, 500].
Upgrade
Version history
2.0.8latest on npm
Audit
Dependencies
axiosrequiredpeer dependency - wrapper relies on Axios for HTTP requests
Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
axios-master — npm install axios-master · libregistry