Registry / devops / redaxios

redaxios

JSON →
library0.5.1jsnpmunverified

A tiny, 800-byte wrapper around the native Fetch API that provides the same API as Axios. Version 0.5.1 is the latest stable release. It is designed as a lightweight alternative to Axios for modern browsers and environments where Fetch is available. Unlike Axios, it has no built-in progress events, no automatic JSON parsing for errors, and no support for older browsers without a fetch polyfill. It is best suited for reducing bundle size when full Axios is not needed.

npm install redaxios
INSTALL
IMPORT
SIG · REDAXIOS
R
redaxios
devopsjavascriptv0.5.1
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 (axios)
✓ import axios from 'redaxios'
✗ const axios = require('redaxios')
Package is ESM-only; CommonJS require() will fail unless using a bundler that handles ESM.
use default export as function to create instance
✓ import axios from 'redaxios'; const instance = axios.create({ baseURL: 'https://api.example.com' })
✗ import { create } from 'redaxios'
Only default export is provided; named exports like create do not exist.
type imports (TypeScript)
✓ import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'redaxios'
TypeScript types are bundled with the package; reuse types from Axios for consistency.

Fetches repository info from GitHub using the Axios-like API provided by redaxios.

import axios from 'redaxios'; async function main() { const response = await axios.get('https://api.github.com/repos/developit/redaxios'); console.log(response.data); } main().catch(console.error);
Debug
Known issues
gotchaError responses may not include a parsed JSON body like Axios does; the data property may be a string or undefined.
fix
Manually parse error responses with try-catch and JSON.parse() if needed.
affects: >=0.0.0
gotchaNo support for request cancellation via CancelToken; use AbortController instead.
fix
Pass an AbortSignal via the signal option in the request config.
affects: >=0.0.0
gotchaNo progress event support (e.g., onUploadProgress).
fix
Fall back to using fetch directly if progress events are required.
affects: >=0.0.0
gotchaOld environment? You must polyfill fetch and Promise yourself.
fix
Include a fetch polyfill like whatwg-fetch and ensure Promise support.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'redaxios'
Missing installation or incorrect import path
fix
Run 'npm install redaxios' and ensure import statement is correct.
TypeError: axios.get is not a function
Using named imports instead of default import
fix
Use 'import axios from 'redaxios'' instead of '{ axios }'.
Uncaught ReferenceError: fetch is not defined
Running in a non-browser environment or older Node.js without fetch support
fix
Use Node.js version 18+ or install a fetch polyfill like 'node-fetch'.
Cannot read property 'data' of undefined
Assuming Axios behavior where error responses always have a data property
fix
Check the response object shape and handle non-JSON responses manually.
Upgrade
Version history
0.5.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
redaxios — npm install redaxios · libregistry