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

@denis_bruns/http-axios

v0.1.2

Published

> **A robust Axios‑based HTTP client with middleware support** > Built on top of RxJS and leveraging core types from `@denis_bruns/core`, this client allows you to compose, modify, and execute HTTP requests using a middleware chain. It integrates seamle

Readme

@denis_bruns/http-axios

A robust Axios‑based HTTP client with middleware support
Built on top of RxJS and leveraging core types from @denis_bruns/core, this client allows you to compose, modify, and execute HTTP requests using a middleware chain. It integrates seamlessly with a variety of middleware—for example, injecting secret headers or environment variables—using a functional, composable approach.

NPM Version
TypeScript
License: MIT
GitHub


Overview

@denis_bruns/http-axios is a TypeScript HTTP client built on top of Axios that:

  • Leverages RxJS for asynchronous request handling and composition.
  • Supports a middleware pipeline—via integration with @denis_bruns/http-middleware—to modify or extend requests before they are sent.
  • Handles common HTTP methods (GET, POST, PUT, PATCH, DELETE) with type-safe request and response options.
  • Integrates seamlessly with the core types defined in @denis_bruns/core, enabling a consistent developer experience in clean architecture projects.

Key Features

  • Middleware Support:
    Chain middleware to modify request headers, query parameters, or other configurations. Middleware are composed using a factory that merges successive HTTP client configurations.

  • RxJS Integration:
    All request methods return an Observable. You can further compose these Observables with the full power of RxJS operators.

  • Flexible Request Methods:
    Provides helper methods for GET, POST, PUT, PATCH, and DELETE. Optionally, full Axios responses can be returned.

  • Type-Safe Request Configuration:
    Leverages types (from @denis_bruns/core) for request options, ensuring that your HTTP configurations remain robust and predictable.

  • Seamless Axios Integration:
    Uses Axios under the hood to perform actual HTTP requests while allowing for central configuration and middleware-driven modifications.


Installation

Using npm:

npm install @denis_bruns/http-axios

Or with yarn:

yarn add @denis_bruns/http-axios

Make sure to install peer dependencies if not already installed:

npm install axios rxjs @denis_bruns/core

Basic Usage

Below is a basic example showing how to create an instance of the HTTP client, use middleware, and perform GET and POST requests.

import { HttpClientAxios } from '@denis_bruns/http-axios';
import { HttpClientRequestOptions } from '@denis_bruns/core';
import { of } from 'rxjs';
import { lastValueFrom } from 'rxjs';

// Example middleware that adds a custom header
const addCustomHeaderMiddleware = (config: HttpClientRequestOptions) => {
  return of({
    ...config,
    headers: { ...config.headers, 'X-Custom-Header': 'custom-value' }
  });
};

// Create an instance with a base URL and middleware chain
const client = new HttpClientAxios('https://api.example.com', [addCustomHeaderMiddleware]);

// Making a GET request
async function fetchData() {
  const data = await lastValueFrom(client.get<{ id: number; name: string }>('/test'));
  console.log('GET response data:', data);
}

// Making a POST request with a body
async function postData() {
  const payload = { name: 'John Doe' };
  const data = await lastValueFrom(client.post<{ id: number; name: string }, typeof payload>('/user', payload));
  console.log('POST response data:', data);
}

fetchData();
postData();

Explanation

  • Middleware:
    The example middleware addCustomHeaderMiddleware takes the initial HTTP client configuration and returns a new configuration object with an extra header.

  • GET & POST Methods:
    The client exposes helper methods corresponding to common HTTP verbs. You can also use the generic request method for more advanced scenarios.

  • RxJS Observables:
    All methods return an Observable, which you can compose and convert (here, via lastValueFrom) as needed.


Advanced Configuration

Returning Full Axios Responses

To obtain the complete Axios response (not only the data), set the returnFullResponse flag to true:

const fullResponse$ = client.request<{ id: number }, true>('GET', '/full-response', {
  returnFullResponse: true
});

Middleware Composition

Middleware functions are composed using createHttpClientMiddlewareFactory from @denis_bruns/http-middleware. This allows you to run multiple transformations over the request configuration and merge the results. For details on creating custom middleware chains, please consult the documentation in the http-middleware package.


Related Packages

  • @denis_bruns/core
    NPM
    GitHub
    Provides the core interfaces and types used throughout the ecosystem.

  • @denis_bruns/http-middleware
    NPM

  • GitHub Offers middleware utilities for HTTP clients and composes them into a single request configuration.


Contributing

Contributions, bug reports, or feature requests are always welcome!
Feel free to open an issue or submit a pull request on GitHub.


License

This project is MIT licensed.