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

@browsercore/http1

v0.2.0

Published

HTTP/1.1 client over any duplex byte stream. No knowledge of TLS or TCP — only the protocol.

Readme

@browsercore/http1

npm version coverage lint

An HTTP/1.1 client over any duplex byte stream. Serializes requests, parses responses, and manages the HTTP/1.1 protocol state machine — keep-alive, chunked transfer-encoding, content-encoding decompression, redirect following, and a cookie-header integration seam. Knows nothing about the underlying transport; higher layers (@browsercore/fetch, @browsercore/cookies) compose exclusively through its exports.

Install

npm install @browsercore/http1

Quick usage

import { connectHttp1, RedirectLimitError } from "@browsercore/http1";

const conn = await connectHttp1({ transport });
try {
    const res = await conn.request({
        method: "GET",
        url: "/index.html",
        headers: new Map([["host", "example.com"]]),
        body: { kind: "empty" },
    });
    console.log(res.statusCode, res.body);
} finally {
    await conn.close();
}

Public API

| Export | Kind | Purpose | | --- | --- | --- | | connectHttp1() | function | Wrap a transport with the HTTP/1.1 protocol | | Http1Connection | interface | Public contract higher layers depend on | | Http1ConnectionImpl | class | Concrete connection (serial request/response) | | HttpRequest | interface | Serializable request | | HttpResponse | interface | Parsed response | | HttpBodyKind | discriminated union | empty / bytes body | | HttpMethod | literal union | Supported HTTP methods | | Http1ConnectionState | discriminated union | idle \| in_flight \| closing \| closed | | Http1CloseReason | discriminated union | Why a connection closed | | Http1Options | interface | Options for connectHttp1() | | CookieInterceptor | interface | Cookie-jar integration seam | | serializeRequest() | function | Request → wire bytes | | parseResponse() | function | Wire bytes → response + bytes consumed | | parseChunkedEncoding() | function | Decode a chunked body stream | | decompressBody() | function | Decode a content-encoding body | | followRedirects() | function | Standalone redirect-following helper | | Http1Error | class | Base typed error | | RedirectLimitError | class | Redirect chain exceeded | | InvalidResponseError | class | Unparseable response bytes | | ContentEncodingError | class | Unsupported/corrupt content-encoding | | ChunkEncodingError | class | Malformed chunked encoding |

Dependency graph

@browsercore/http1
  └─ @browsercore/compression
  └─ @browsercore/transport
        └─ node:net / node:dns / node:crypto

@browsercore/compression wraps node:zlib; @browsercore/http1 calls it never node:zlib directly.

License

MIT