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

neuer-axios-wrapper

v1.0.0

Published

A lightweight and stupidly simple API wrapper built on Axios, designed for direct browser use with a <script> tag.

Readme

Neuer Axios Wrapper

Neuer Axios Wrapper is a simple and lightweight JavaScript utility designed to make API requests easy and readable. It is not intended for npm installations but for direct use in the browser with a <script> tag. This utility is perfect for quick prototypes or lightweight applications without complex bundlers or dependency management.

Why Use This Wrapper?

  • Zero Setup: No npm or build steps—just include it with a <script> tag.
  • Human-Readable API Calls: Call your endpoints directly as methods, with automatic URL and options handling.
  • Friendly Debugging: Warns you when something's off and provides error roasting to point you in the right direction.
  • No Bloat: Leverages axios but keeps everything simple and secure with modern JavaScript techniques.

Installation

Add the script directly to your HTML:

<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script src="path/to/neuer-axios-wrapper.js"></script>

Example Usage

Basic Setup

// Initialize the API wrapper
const api = API('https://jsonplaceholder.typicode.com/', {
    headers: { 'Content-Type': 'application/json' },
});

// Use the API
(async () => {
    // GET request to /posts
    const posts = await api.posts();
    console.log(posts);

    // POST request to /posts
    const newPost = await api.posts({
        method: 'POST',
        data: {
            title: 'foo',
            body: 'bar',
            userId: 1,
        },
    });
    console.log(newPost);
})();

Custom Options per Request

You can override defaultOptions for specific requests:

(async () => {
    // GET request with query parameters
    const comments = await api.comments({
        params: { postId: 1 },
    });
    console.log(comments);
})();

Error Handling

The wrapper provides clear and helpful error messages:

  • Missing baseURL:

    🚨 Warning: baseURL is empty! Are you trying to call 'undefined' endpoints? Please fix your baseURL. 🤦‍♂️
  • Request Error:

    💥 API Error: Server returned status 404 for posts.
    👉 Response: { error: 'Not Found' }
  • Network Issues:

    📡 Network Error: No response for posts. Are you sure your server isn't snoozing? 💤
  • Unauthorized Access:

    💥 Unauthorized access: Stop poking around private stuff, noob!

API Reference

API(baseURL, defaultOptions)

  • baseURL: (string) The base URL for all API requests. If empty, a warning is displayed.
  • defaultOptions: (object) Default options passed to Axios for every request.

Returns a proxy object where each property corresponds to an endpoint. You can call the endpoint directly, optionally passing Axios options.

Proxy Behavior

  • api.endpoint(options):
    • options: (object) Overrides for the default Axios options, e.g., method, headers, data, or params.
    • Returns: The response data or null on error.

Example Endpoints

api.posts();        // GET request to /posts
api.posts({         // POST request to /posts
    method: 'POST',
    data: { title: 'New Post' },
});

License

ISC