Registry / devops / konfig-axios-fetch-adapter

konfig-axios-fetch-adapter

JSON →
library1.6.4jsnpmunverified

A TypeScript-written fetch adapter for axios, enabling use of the native Fetch API instead of XMLHttpRequest in Node.js and browser environments. Currently at version 1.6.4, it is actively maintained with frequent updates. Key differentiators: lightweight, no additional dependencies beyond axios itself (>=1.6.4), full TypeScript support, and easy drop-in replacement for the default adapter. Ideal for environments with limited XMLHttpRequest support or for leveraging streaming features.

npm install konfig-axios-fetch-adapter
INSTALL
IMPORT
SIG · KONFIG-AXIOS-FETCH
K
konfig-axios-fetch-adapter
devopsjavascriptv1.6.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.

default
import fetchAdapter from 'konfig-axios-fetch-adapter'
import { fetchAdapter } from 'konfig-axios-fetch-adapter'
Default export, not named.
fetchAdapter
const fetchAdapter = require('konfig-axios-fetch-adapter').default
const { fetchAdapter } = require('konfig-axios-fetch-adapter')
CommonJS requires .default access.
AxiosFetchAdapterConfig
import fetchAdapter, { AxiosFetchAdapterConfig } from 'konfig-axios-fetch-adapter'
import { AxiosFetchAdapterConfig } from 'konfig-axios-fetch-adapter' // missing default
Import type alongside default.

Basic usage: create an Axios instance or request using the fetch adapter to use native Fetch API.

import axios from 'axios'; import fetchAdapter from 'konfig-axios-fetch-adapter'; const response = await axios.get('https://api.example.com/data', { adapter: fetchAdapter, }); console.log(response.data);
Debug
Known issues
gotchaRequires axios >=1.6.4; using older versions will cause runtime errors.
fix
Upgrade axios to 1.6.4 or later.
affects: <1.6.4
breakingAdapter is ESM-only; cannot be imported via CommonJS require without default access trick.
fix
Use dynamic import or require with .default.
affects: >=1.0.0
deprecatedFuture versions may drop support for older Node.js versions (<18).
fix
Use Node.js 18+ or polyfill fetch globally.
affects: >=1.6.0
gotchaCookie and cancellation token support differ from XHR adapter; test thoroughly.
fix
Review fetch API limitations; use Axios cancellation tokens as usual, but browser cookies may not be sent same origin.
affects: >=1.0.0
Errors
Common errors & fixes
Adapter is not a function
Incorrect import: using named import instead of default import.
fix
Use `import fetchAdapter from 'konfig-axios-fetch-adapter'` or `require(...).default`.
Cannot find module 'konfig-axios-fetch-adapter'
Package not installed or missing from node_modules.
fix
Run `npm install konfig-axios-fetch-adapter`.
TypeError: Failed to fetch
Network error or CORS issue; fetch adapter is being used but request fails.
fix
Check network connectivity and server CORS configuration.
Upgrade
Version history
1.6.4latest on npm
Audit
Dependencies
axiosrequiredRuntime peer dependency; the adapter plugs into axios's adapter system.
Agent activity
4 hits · last 30 days
node
4
Resources
konfig-axios-fetch-adapter — npm install konfig-axios-fetch-adapter · libregistry