Registry / http-networking / extrareqp2

extrareqp2

JSON →
library1.0.0jsnpmunverified

Axios is a promise-based HTTP client for both browser and Node.js. The current stable version is 1.0.0. It provides a simple API for making XMLHttpRequests in the browser and http requests in Node.js, with features like interceptors, automatic JSON transformation, and request cancellation. Axios is widely used due to its ease of use, support for older browsers (IE11), and TypeScript types. It follows semver and has a consistent release cadence with minor updates every few months.

npm install extrareqp2
INSTALL
IMPORT
SIG · EXTRAREQP2
E
extrareqp2
http-networkingjavascriptv1.0.0
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.

axios
import axios from 'axios'
const axios = require('axios')
Default import. Axios is ESM-compatible since v1; CommonJS require still works in Node.
AxiosInstance
import axios, { AxiosInstance } from 'axios'
const { AxiosInstance } = require('axios')
Type-only import for TypeScript users. Available in v1+.
AxiosRequestConfig
import axios, { AxiosRequestConfig } from 'axios'
const { AxiosRequestConfig } = require('axios')
Type only, used for custom configs. Cannot be value-imported via require.
AxiosResponse
import { AxiosResponse } from 'axios'
import { response } from 'axios'
Correct symbol is AxiosResponse, not 'response'. TypeScript type.

Shows a GET request with params, error handling with axios.isAxiosError, and async/await usage.

import axios from 'axios'; async function main() { try { const response = await axios.get('https://api.example.com/data', { params: { key: process.env.API_KEY ?? '' }, timeout: 5000 }); console.log(response.data); } catch (error) { if (axios.isAxiosError(error)) { console.error('Axios error:', error.message); } else { console.error('Unexpected error:', error); } } } main();
Debug
Known issues
breakingStarting from v0.22.0, Axios supports ES modules and has changed default export behavior.
fix
Use import axios from 'axios' instead of require('axios'). In TypeScript, use esModuleInterop.
affects: >=0.22.0
deprecatedThe `adapter` config option is deprecated in favor of `httpAdapter` and `xhrAdapter`.
fix
Use `httpAdapter` for Node.js or `xhrAdapter` for browser instead of `adapter`.
affects: >=1.0.0
gotchaAxios v1 changed the default response type from `text` to `json` for all requests, including those that return non-JSON content.
fix
Set `responseType: 'text'` explicitly if expecting non-JSON responses, or use `transformResponse`.
affects: >=1.0.0
breakingInitial release of extrareqp2 is a fork of axios v1.0.0? Check version history.
fix
Refer to axios documentation for compatibility; extrareqp2 may have unknown breaking changes.
affects: 1.0.0
deprecatedThe `CancelToken` API is deprecated; use `AbortController` instead.
fix
Use AbortController from the platform (browser or Node.js 16+) to cancel requests.
affects: >=0.22.0
gotchaaxios.post(url, data, config) does NOT automatically stringify data; set `Content-Type` header manually if needed.
fix
For JSON, ensure data is an object and Axios will set Content-Type: application/json automatically. For form data, use URLSearchParams or FormData.
affects: *
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'data')
Trying to access response.data when request failed and error.response is undefined.
fix
Check if error.response exists before accessing data: if (error.response) { console.log(error.response.data); }
Module not found: Error: Can't resolve 'axios'
Axios is not installed or incorrectly imported in a browser environment.
fix
Run `npm install axios` and ensure the import path is correct. For CDN, use script tag.
Uncaught (in promise) Error: Network Error
Request failed due to network issues (e.g., CORS, no internet, blocked request).
fix
Check browser console for CORS errors, ensure endpoint is reachable, and configure CORS on server.
TypeError: _axios.default.get is not a function (or axios.get is not a function)
Using import axios from 'axios' in a CommonJS module without esModuleInterop.
fix
Use `const axios = require('axios')` in Node.js CJS or enable esModuleInterop in tsconfig.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
extrareqp2 — npm install extrareqp2 · libregistry