Registry / devops / axios-easy

axios-easy

JSON →
library0.2.6jsnpmunverified

Axios-easy is a modular TypeScript library (v0.2.6) that extends axios with composable interceptors and utilities for standardizing HTTP request/response handling. It provides plug-and-play interceptors for authentication, error handling, payload normalization, parameter serialization, and file processing. Currently in early development (pre-1.0), it offers tree-shakable imports, i18n support for error messages, full TypeScript types, and unit tests. Its key differentiators include a lego-like composition model, easy integration with openapi-ts-request, and minimal overhead via selective interceptor usage.

npm install axios-easy
INSTALL
IMPORT
SIG · AXIOS-EASY
A
axios-easy
devopsjavascriptv0.2.6
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.

createRequestClient
import { createRequestClient } from 'axios-easy'
import createRequestClient from 'axios-easy'
Named export, not default. Works with both CJS and ESM.
defaultRequestInterceptor
import { defaultRequestInterceptor } from 'axios-easy/default-request-interceptor'
import { defaultRequestInterceptor } from 'axios-easy'
Interceptor must be imported from its own subpath to enable tree-shaking.
authenticateInterceptor
import { authenticateInterceptor } from 'axios-easy/authenticate-interceptor'
import { authenticateInterceptor } from 'axios-easy'
Subpath import required; exact path may vary—check docs for full list.

Creates an axios client with default request and response interceptors, plus localized error messages.

import axios from 'axios'; import { createRequestClient } from 'axios-easy'; import { defaultRequestInterceptor } from 'axios-easy/default-request-interceptor'; import { defaultResponseInterceptor } from 'axios-easy/default-response-interceptor'; import { errorMessageInterceptor } from 'axios-easy/error-message-interceptor'; const client = createRequestClient({ baseURL: 'https://api.example.com', timeout: 10000, interceptors: [ defaultRequestInterceptor(), defaultResponseInterceptor(), errorMessageInterceptor({ lang: 'en' }), ], }); async function main() { try { const response = await client.get('/users'); console.log(response.data); } catch (error) { console.error('Request failed:', error); } } main();
Debug
Known issues
gotchaInterceptors must be imported from subpaths (e.g., 'axios-easy/default-request-interceptor') to enable tree-shaking; importing from 'axios-easy' may increase bundle size.
fix
Use the correct subpath import for each interceptor individually.
affects: >=0.0.0
gotchaAxios version should be 1.12.0 or later to avoid TypeScript type errors.
fix
Upgrade axios to >=1.12.0 in your package.json.
affects: >=0.0.0
deprecatedPackage is v0.x and may have breaking changes before 1.0.0.
fix
Pin to exact version and test upgrades carefully.
affects: >=0.0.0 <1.0.0
Errors
Common errors & fixes
Cannot find module 'axios-easy' or its corresponding type declarations.
Package is not installed or module resolution config is missing.
fix
Run 'npm install axios-easy' and ensure 'moduleResolution' is 'node' or 'bundler' in tsconfig.json.
Module '"axios-easy/authenticate-interceptor"' has no exported member 'authenticateInterceptor'.
Typo in import path or incorrect interceptor name.
fix
Double-check the subpath and export name in the documentation; ensure the interceptor is imported as a named export.
TypeError: axios is not a function
Missing or incompatible version of axios peer dependency.
fix
Install axios >=1.12.0: 'npm install axios@latest'.
Upgrade
Version history
0.2.6latest on npm
Audit
Dependencies
axiosrequiredrequired peer dependency; axios 1.12.0+ recommended for TypeScript compatibility
Agent activity
12 hits · last 30 days
node
8
Amazon
1
OpenAI (training)
1
Resources
axios-easy — npm install axios-easy · libregistry