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 🙏

© 2025 – Pkg Stats / Ryan Hefner

acchio

v1.0.0

Published

A lightweight HTTP client for making requests in both browser and Node.js environments, inspired by Axios.

Readme

⚡ Acchio

An elegant and powerful HTTP client for Node.js and browsers — inspired by Axios, with a touch of magic! ✨

npm version npm downloads license types


Acchio is a modern, fully typed, zero-dependency HTTP client with native support for interceptors, request cancellation, XML, and compatibility with both Node.js and browsers.

Because HTTP requests should feel magical, not complicated! 🎩✨


📚 Table of Contents


🚀 Installation

# npm
npm install acchio

# yarn
yarn add acchio

# pnpm
pnpm add acchio

💡 Why Acchio?

  • ✅ 100% TypeScript-native
  • ✅ Works in Node.js and browsers
  • ✅ Powerful interceptors
  • ✅ Request cancellation
  • ✅ Built-in XML support (auto-parse)
  • ✅ Zero dependencies
  • ✅ Familiar Axios-style API

🎯 Basic Usage

import acchio from "acchio";

// Simple GET
const response = await acchio.get("https://api.example.com/users");
console.log(response.data);

// POST with payload
await acchio.post("https://api.example.com/users", {
  name: "John",
  email: "[email protected]",
});

📋 Request Configuration

const config = {
  url: "/users",
  method: "GET",
  baseURL: "https://api.example.com",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer token",
  },
  params: { page: 1 },
  timeout: 5000,
  responseType: "json",
};

Supported response types:

  • json
  • text
  • blob
  • arraybuffer
  • xml

🔧 Interceptors

// Automatically attach token
acchio.interceptors.request.use((config) => {
  config.headers.Authorization = `Bearer ${getToken()}`;
  return config;
});

// Log requests
acchio.interceptors.request.use((config) => {
  console.log(`🟡 ${config.method?.toUpperCase()} → ${config.url}`);
  return config;
});

// Manipulate responses
acchio.interceptors.response.use((response) => {
  console.log("🟢 Status:", response.status);
  return response;
});

🚫 Request Cancellation

const source = acchio.CancelToken.source();

acchio
  .get("/api/data", { cancelToken: source.token })
  .then((res) => console.log(res.data))
  .catch((err) => {
    if (acchio.isCancel(err)) console.log("Cancelled:", err.message);
  });

// Cancel request
source.cancel("User aborted the request");

🌐 XML Support

// Auto-parsed XML response
const res = await acchio.get("/feed.xml");
console.log(res.data);

🎨 Global Configuration

import acchio from "acchio";

acchio.defaults.baseURL = "https://api.mysite.com";
acchio.defaults.timeout = 5000;
acchio.defaults.headers.common["X-App"] = "Acchio";

Create custom instances:

const api = acchio.create({
  baseURL: "https://api.company.com",
  headers: { Authorization: "Bearer token" },
});

🚦 HTTP Methods

acchio.get("/users");
acchio.post("/users", { name: "Maria" });
acchio.put("/users/1", { name: "John" });
acchio.patch("/users/1", { email: "[email protected]" });
acchio.delete("/users/1");

🎪 TypeScript Support

interface User { id: number; name: string; email: string; }

const res = await acchio.get<User[]>('/api/users');
const users = res.data; // ✅ Fully typed

🔄 Environment Examples

Node.js

const res = await acchio.get("https://api.github.com/users");

React

useEffect(() => {
  const source = acchio.CancelToken.source();
  acchio
    .get("/api/users", { cancelToken: source.token })
    .then((res) => setUsers(res.data))
    .catch(console.error);
  return () => source.cancel();
}, []);

🚨 Error Handling

try {
  await acchio.get("/api/data");
} catch (error) {
  if (acchio.isCancel(error)) console.log("Request cancelled");
  else if (error.response) console.log("Status:", error.response.status);
}

📊 Quick Comparison

| Feature | ⚡ Acchio | 📦 Axios | | ------------------ | -------------- | --------- | | TypeScript Typings | ✅ Native | ✅ | | Cancellation | ✅ | ✅ | | Interceptors | ✅ | ✅ | | Node.js + Browser | ✅ | ✅ | | XML Support | ✅ | ❌ | | Zero Dependencies | ✅ | ❌ | | Size | 🪶 Lightweight | 📦 Medium |

📄 License

MIT — Free for everyone! 🎉

🎊 Acknowledgements

Thank you for using Acchio! If you liked it, don’t forget to:

"Because HTTP requests should feel magical, not complicated!" 🎩✨

🔗 Project Links