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

axios-api-plus

v1.0.2

Published

A simple, production-ready Axios wrapper for streamlined API data fetching and CRUD operations. Supports all standard HTTP methods, interceptors, error normalization, token-based authentication, and more.

Readme

Axios-api-plus

A simple, production-ready Axios wrapper for streamlined API data fetching and CRUD operations. Supports all standard HTTP methods, interceptors, error normalization, token-based authentication, and more.

Features

  • Base URL configuration
  • Request and response interceptors
  • Centralized error handling and response normalization
  • Token-based authentication (optional)
  • Supports async/await and Promises
  • Customizable headers and timeout
  • TypeScript support

Installation

npm install axios-api-plus

Usage

import { AxiosApi } from 'axios-api-plus';

const api = new AxiosApi({
  baseURL: 'https://api.example.com',
  timeout: 8000,
  headers: { 'X-Custom-Header': 'foobar' },
  token: 'your-jwt-token', // optional
});

// GET request
const data = await api.get('/users');

// POST request
const created = await api.post('/users', { name: 'Alice' });

// PUT request
await api.put('/users/1', { name: 'Bob' });

// PATCH request
await api.patch('/users/1', { name: 'Charlie' });

// DELETE request
await api.delete('/users/1');

// Set or remove token dynamically
api.setToken('new-token');
api.removeToken();

API Reference

new AxiosApi(config)

  • baseURL (string): Base URL for all requests
  • timeout (number): Request timeout in ms (default: 10000)
  • headers (object): Default headers
  • token (string, optional): Bearer token for Authorization header

Methods

  • get<T>(url, config?)
  • post<T>(url, data?, config?)
  • put<T>(url, data?, config?)
  • patch<T>(url, data?, config?)
  • delete<T>(url, config?)
  • setToken(token: string)
  • removeToken()

All methods return a Promise of the response data.

Error Handling

All errors are normalized to:

{
  message: string;
  status?: number;
  data?: any;
  isAxiosError: boolean;
}

Interceptors

You can customize interceptors by editing the setupInterceptors method in the source.

License

MIT

👤 Author

Akshay Bhalala


Happy API fetching! 🎉


🏷️ Keywords

axios, api, wrapper, http, fetch, rest, typescript, request, response, interceptor, token, authentication, error-handling, promise, async, client, crud, javascript, nodejs