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

michi-http-abstractions

v1.0.0

Published

A framework-agnostic JavaScript library with HTTP utilities and .NET-inspired abstractions.

Readme

michi-http-abstractions

A framework-agnostic JavaScript library with HTTP utilities and .NET-inspired abstractions.

Key Features

  • Small, composable units for building reusable HTTP logic.
  • Framework-agnostic: works in Node.js, Deno, browsers, and edge runtimes.
  • TypeScript support with well-defined types.

Why michi-http-abstractions?

michi-http-abstractions offers a structured and extensible approach to working with HTTP in JavaScript and TypeScript, inspired by the .NET HttpClient architecture. It introduces abstractions like HttpClient, HttpRequestMessage, HttpContent, and HttpHandler to enable clean separation of concerns and reusable HTTP logic.

You can build flexible pipelines by composing HttpHandlers, making it easy to add cross-cutting behaviors like logging, retries, or authentication in a clean and modular way.

The library also supports custom HttpContent implementations, giving you full control over how request data is serialized, structured, and transmitted.

Built to be framework-agnostic, it runs consistently across Node.js, Deno, browsers, and edge runtimes, providing a unified and type-safe experience across environments.

Installation

npm i michi-http-abstractions

Compatibility

michi-http-abstractions is compatible with any framework or runtime that supports ES2024.

Usage Examples

Fetch blogs from an API

import { HttpClient, HttpFetchHandler, HttpRequestMessage, HttpMethod } from "michi-http-abstractions";

await using client = new HttpClient(new HttpFetchHandler(), true);

const request = new HttpRequestMessage(HttpMethod.Get, "https://api.example.com/blogs");
const response = await client.send(request);
response.ensureSuccessStatusCode();

const blogs = JSON.parse(await response.content.readAsString());
for (const blog of blogs) {
	console.log(blog.title);
	console.log(blog.body);
}

Upload a file to an API

import {
	HttpClient,
	HttpFetchHandler,
	HttpRequestMessage,
	HttpMethod,
	MultipartFormDataContent,
	ByteArrayContent,
} from "michi-http-abstractions";

const audioFile = new Uint8Array();

await using client = new HttpClient(new HttpFetchHandler(), true);
client.baseAddress = new URL("https://api.example.com/");
client.defaultRequestHeaders.add("Authorization", "Bearer ABC_XYZ");

const request = new HttpRequestMessage(HttpMethod.Post, "files");
const multipart = new MultipartFormDataContent();
multipart.add(new ByteArrayContent(audioFile, "audio/ogg"), "file");
request.content = multipart;

const response = await client.send(request);
response.ensureSuccessStatusCode();

Chain multiple HttpHandlers to create more complex pipelines

import {
	HttpRequestMessage,
	DelegatingHandler,
	HttpClient,
	HttpFetchHandler,
	HttpMethod,
} from "michi-http-abstractions";

class LogHandler extends DelegatingHandler {
	public async send(message: HttpRequestMessage, abortSignal: AbortSignal) {
		abortSignal.throwIfAborted();
		console.log(`${message.method.name} ${message.requestUri.toString()}`);
		return await super.send(message, abortSignal);
	}
}

const handler = new LogHandler(new HttpFetchHandler(), true);
await using client = new HttpClient(handler, true);

const request = new HttpRequestMessage(HttpMethod.Get, "https://api.example.com/blogs");
await client.send(request); // Will log "GET https://api.example.com/blogs"
// and then send the request.

[!NOTE] This library is primarily developed for personal use. However, it is well documented and maintained, and I am open to evolving it into a more polished and broadly suitable solution for public use. If you have suggestions, feedback, or would like to contribute to making it more robust, feel free to reach out or open an issue.