Registry / devops / axios-request-handler

axios-request-handler

JSON →
library1.0.4jsnpmunverified

An Axios wrapper that adds polling, lock, and cancel support for HTTP requests. Version 1.0.4 released in 2019, no recent updates. Provides a simple class-based API with methods for get, post, poll, cancel, and status checks. Differentiates from raw Axios by offering built-in request deduplication (lockable/cancelable) and polling with interval callbacks.

npm install axios-request-handler
INSTALL
IMPORT
SIG · AXIOS-REQUEST-HAND
A
axios-request-handler
devopsjavascriptv1.0.4
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.

Request
import Request from 'axios-request-handler';
const { Request } = require('axios-request-handler');
Default export; CommonJS require returns the constructor directly, not a named export.
Request
import Request from 'axios-request-handler';
import { Request } from 'axios-request-handler';
Named import will not work; the package exports a single default class.
Request
const Request = require('axios-request-handler').default;
const Request = require('axios-request-handler');
In CommonJS, the default export is under .default; direct require returns the constructor if using transpiled code, but safer to use .default.

Shows basic usage: create a Request instance with URL and options, perform GET request, polling with interval, and cancellation.

import Request from 'axios-request-handler'; const products = new Request('https://api.example.com/products', { params: { category: 'keyboards' } }); products.get().then(res => { console.log(res.data); }).catch(err => { console.error(err); }); // Polling example const reviews = new Request('https://api.example.com/reviews'); reviews.poll(5000).get((response) => { console.log(response.data); // return false to stop polling }); // Cancel a request reviews.get(); reviews.cancel('get');
Debug
Known issues
gotchaThe constructor options merge with Axios options but overriding on a per-request basis may not merge deeply; nested objects may be replaced.
fix
Pass full options object to per-request methods like get({ params: ... }).
affects: >=0.0.0
deprecatedPackage is no longer actively maintained since 2019. Use with caution for new projects.
fix
Consider using Axios interceptors or a more modern wrapper like 'axios-hooks' for React.
affects: 1.0.0
gotchaThe 'isUpdating' method returns true only during interval polling when a request is pending. It may not behave as expected outside polling context.
fix
Refer to documentation: isUpdating is specific to polling intervals.
affects: >=0.0.0
gotchaAxios peer dependency version is not specified; may conflict with newer Axios versions (e.g., breaking changes in Axios 1.x).
fix
Lock Axios version to <1.0.0 if using this package.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: Request is not a constructor
Incorrect import using named import instead of default import in ESM.
fix
Use import Request from 'axios-request-handler' (no curly braces).
Cannot find module 'axios-request-handler'
Package not installed or missing from node_modules.
fix
Run npm install axios-request-handler (ensure axios is also installed).
Request(...).get is not a function
The instance was created incorrectly, possibly due to wrong import or missing 'new' keyword.
fix
Ensure proper import and instantiation: const instances = new Request(url, options);
Cannot read property 'data' of undefined
The response object does not have a 'data' property because of a network error or incorrect Axios version.
fix
Check network and Axios version; ensure error handling is in place.
Upgrade
Version history
1.0.4latest on npm
Audit
Dependencies
axiosrequiredpeer dependency for HTTP requests
Agent activity
11 hits · last 30 days
node
8
Amazon
1
OpenAI (training)
1
Resources
axios-request-handler — npm install axios-request-handler · libregistry