Registry / ai-ml / feaxios

feaxios

JSON →
library0.0.23jsnpmunverified

feaxios is a lightweight (2KB) wrapper around the native Fetch API that provides an API almost identical to Axios, including interceptors, configurable timeouts, request/response transforms, and built-in retry support via a dedicated subpackage. Current stable version is 0.0.23, released as an early-stage package with pre-1.0 stability. Key differentiators vs Axios: 80% smaller bundle, no XMLHttpRequest dependency, zero polyfills required in modern browsers. Ideal for bundle-size-sensitive projects that want to migrate from Axios to native fetch without rewriting request logic. Ships TypeScript types. Released under MIT license.

npm install feaxios
INSTALL
IMPORT
SIG · FEAXIOS
F
feaxios
ai-mljavascriptv0.0.23
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 (default export)
import axios from 'feaxios'
const axios = require('feaxios')
ESM-only; no CommonJS exports provided.
axiosRetry
import axiosRetry from 'feaxios/retry'
import { axiosRetry } from 'feaxios'
Retry is a subpath export; must import from 'feaxios/retry'.
AxiosResponse
import type { AxiosResponse } from 'feaxios'
import { AxiosResponse } from 'feaxios'
TypeScript only; use type import to avoid runtime import.

Shows how to create a feaxios instance with a base URL, attach retry logic, add an auth interceptor, and make a GET request.

import axios from 'feaxios'; import axiosRetry from 'feaxios/retry'; // Create instance with base config const http = axios.create({ baseURL: 'https://api.example.com', timeout: 5000, }); // Add retry with exponential backoff axiosRetry(http, { retries: 3, retryDelay: axiosRetry.exponentialDelay }); // Request interceptor (attach auth token) http.interceptors.request.use((config) => { config.headers.set('Authorization', `Bearer ${process.env.API_KEY ?? ''}`); return config; }); // GET request http .get('/users') .then((response) => console.log(response.data)) .catch((error) => console.error(error.message));
Debug
Known issues
breakingfeaxios does not support Node.js built-in http module; only native Browser fetch or Node 18+ fetch.
fix
Ensure runtime supports native fetch (modern browsers, Node 18+). Polyfill not provided.
affects: >=0.0.0
breakingAll response.data is already parsed JSON when responseType is 'json' (default). Do not call JSON.parse() on it.
fix
Access response.data directly as parsed object.
affects: >=0.0.0
deprecatedFeaxios v0.0.23 is pre-1.0; API may change without major semver bump.
fix
Pin version exactly or expect potential breaking changes.
affects: <1.0.0
gotchaThe default export is named `axios` but is feaxios; ensure no naming conflicts with the real axios if both are installed.
fix
Import as a different alias: `import feaxios from 'feaxios'`
affects: >=0.0.0
gotcharetryDelay expects a function, not a number; use axiosRetry.exponentialDelay or custom function.
fix
Provide a function returning milliseconds: `retryDelay: (retryNumber) => retryNumber * 1000`
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: axios is not a function
Using CommonJS require() with ESM-only package.
fix
Use import or switch to dynamic import: import('feaxios').then(m => m.default.get(...))
Cannot find module 'feaxios/retry'
Import path misspelled or package version < 0.0.19 (retry subpath not present).
fix
Ensure feaxios >= 0.0.19 and import exactly: 'feaxios/retry'
response.data is undefined
Response body not JSON or responseType set to 'text' but accessing .data directly.
fix
Check responseType; for non-JSON use response.text() or response.blob() via fetchOptions.
Upgrade
Version history
0.0.23latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
feaxios — npm install feaxios · libregistry