npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, πŸ‘‹, I’m Ryan HefnerΒ  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you πŸ™

Β© 2026 – Pkg Stats / Ryan Hefner

advanced-client-fetch-axios-adapter

v1.0.6

Published

πŸ”„ Axios-compatible adapter for Advanced Client Fetch. Drop-in replacement for Axios with modern fetch-based architecture.

Readme

Advanced Client Fetch - Axios Adapter

npm version Bundle Size License TypeScript

πŸ”„ Axios-compatible adapter for Advanced Client Fetch. Drop-in replacement for Axios with modern fetch-based architecture.

✨ Features

  • 🎯 Axios Compatible: Drop-in replacement for Axios
  • πŸš€ Modern Architecture: Built on Advanced Client Fetch
  • 🌐 Platform Independent: Works on Node.js, Browser, Edge, Deno, Bun
  • πŸ“¦ Lightweight: Only ~3KB gzipped
  • 🎨 TypeScript: Full type safety
  • πŸ”„ Interceptors: Request and response interceptors
  • ⚑ Performance: Better than Axios

πŸ“¦ Installation

npm install advanced-client-fetch-axios-adapter

πŸš€ Quick Start

Basic Usage

import { createAxiosAdapter } from 'advanced-client-fetch-axios-adapter';

const axios = createAxiosAdapter({
  baseURL: 'https://api.example.com',
  timeout: 5000,
  headers: {
    'Authorization': 'Bearer your-token'
  }
});

// Use exactly like Axios
const response = await axios.get('/users');
const newUser = await axios.post('/users', {
  name: 'John Doe',
  email: '[email protected]'
});

With Interceptors

import { createAxiosAdapter } from 'advanced-client-fetch-axios-adapter';

const axios = createAxiosAdapter({
  baseURL: 'https://api.example.com'
});

// Request interceptor
axios.interceptors.request.use(
  (config) => {
    config.headers.Authorization = `Bearer ${getToken()}`;
    return config;
  },
  (error) => Promise.reject(error)
);

// Response interceptor
axios.interceptors.response.use(
  (response) => response,
  (error) => {
    if (error.response?.status === 401) {
      // Handle unauthorized
      redirectToLogin();
    }
    return Promise.reject(error);
  }
);

Advanced Configuration

import { createAxiosAdapter } from 'advanced-client-fetch-axios-adapter';

const axios = createAxiosAdapter({
  baseURL: 'https://api.example.com',
  timeout: 10000,
  headers: {
    'Content-Type': 'application/json',
    'User-Agent': 'MyApp/1.0.0'
  },
  validateStatus: (status) => status < 500,
  transformRequest: [(data) => JSON.stringify(data)],
  transformResponse: [(data) => JSON.parse(data)],
  paramsSerializer: (params) => new URLSearchParams(params).toString()
});

πŸ”„ Migration from Axios

// Before (Axios)
import axios from 'axios';
const response = await axios.get('/api/users');

// After (Advanced Client Fetch Axios Adapter)
import { createAxiosAdapter } from 'advanced-client-fetch-axios-adapter';
const axios = createAxiosAdapter();
const response = await axios.get('/api/users');

πŸ“š API Reference

createAxiosAdapter(options)

Creates an Axios-compatible client.

Options:

  • baseURL?: string - Base URL for requests
  • timeout?: number - Request timeout in milliseconds
  • headers?: Record<string, string> - Default headers
  • validateStatus?: (status: number) => boolean - Status validation function
  • transformRequest?: any[] - Request transformers
  • transformResponse?: any[] - Response transformers
  • paramsSerializer?: (params: any) => string - Params serializer

Methods

  • get(url, config?) - GET request
  • post(url, data?, config?) - POST request
  • put(url, data?, config?) - PUT request
  • patch(url, data?, config?) - PATCH request
  • delete(url, config?) - DELETE request
  • head(url, config?) - HEAD request
  • options(url, config?) - OPTIONS request

Interceptors

  • interceptors.request.use(onFulfilled?, onRejected?) - Request interceptor
  • interceptors.response.use(onFulfilled?, onRejected?) - Response interceptor

🌐 Platform Support

  • βœ… Node.js 18+
  • βœ… Browsers (modern)
  • βœ… Edge Runtime (Vercel, Cloudflare)
  • βœ… Deno 1.0+
  • βœ… Bun 1.0+

πŸ“Š Bundle Size

  • Size: ~3KB gzipped
  • Dependencies: Only advanced-client-fetch

πŸ§ͺ Testing

npm test
npm run test:watch
npm run test:coverage

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments