Registry / devops / axios-q

axios-q

JSON →
library1.1.5jsnpmunverified

An Axios plugin that provides request queue management, enabling features such as request deduplication (unique), global interceptors, and custom request/response handling. Currently at version 1.1.5, the package is in maintenance mode and the author recommends migrating to the more comprehensive axios-ex. It supports TypeScript and is designed for use with Axios in both Node.js and browser environments. Differentiators include simple queue configuration and built-in cancel mechanisms, but it is largely superseded by axios-ex.

npm install axios-q
INSTALL
IMPORT
SIG · AXIOS-Q
A
axios-q
devopsjavascriptv1.1.5
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
import axiosQueue from 'axios-q'
const axiosQueue = require('axios-q').default
Default export is available; CommonJS users must use .default or use require('axios-q') if the library allows, but the correct ESM pattern is to import default directly.
create
import { create } from 'axios-q'
const create = require('axios-q').create
Named export 'create' is available for direct import.
AxiosQueueInstance
import type { AxiosQueueInstance } from 'axios-q'
import { AxiosQueueInstance } from 'axios-q'
TypeScript users should use `import type` for type-only imports to avoid runtime overhead.

Demonstrates creating an axios instance with queue support, including unique request deduplication and custom interceptors.

import axiosQueue from 'axios-q'; import axios from 'axios'; const options = { unique: true, setHeaders(instance) { instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; }, onRequest(config) { // modify config before request return config; }, onRequestError(err) {}, onResponse(res) { if (res.data.success) return res.data; return Promise.reject(res.data); }, onResponseError(err) {}, onError(err) {}, onCancel(err) {} }; axiosQueue.create(options).then(instance => { // use instance like a normal axios instance instance.get('/api/data').then(response => console.log(response)); }).catch(err => console.error(err));
Debug
Known issues
deprecatedThe axois-q package is deprecated in favor of axios-ex. No new features will be added.
fix
Migrate to axios-ex by installing npm install axios-ex and following its documentation.
affects: >=1.0.0
gotchaThe 'create' function returns a Promise, not an axios instance directly. Common mistake is to try to use it synchronously.
fix
Always use await or .then() on the result of axiosQueue.create() to get the axios instance.
affects: >=1.0.0
breakingThe CJS require() does not expose the module directly; you must use .default to get the default export.
fix
Use const axiosQueue = require('axios-q').default; or use 'import axiosQueue from 'axios-q'' with ESM.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: axiosQueue.create is not a function
Using CommonJS require() without .default, or importing incorrectly.
fix
Use const axiosQueue = require('axios-q').default; or use import axiosQueue from 'axios-q';
Cannot read properties of undefined (reading 'get')
Trying to use the result of axiosQueue.create() as an axios instance directly, but create() returns a Promise.
fix
Use await or .then() to unwrap the Promise: const instance = await axiosQueue.create(options); instance.get(...);
ERR_PACKAGE_PATH_NOT_EXPORTED: Package subpath './package.json' is not defined by "exports"
Importing from a path that is not exposed by the package's exports map.
fix
Use only the package name as the import source: import axiosQueue from 'axios-q'; no subpaths.
Upgrade
Version history
1.1.5latest on npm
Audit
Dependencies
axiosrequiredpeer dependency; axios-q acts as a wrapper around Axios instances
Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
axios-q — npm install axios-q · libregistry