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

plgg-http

v0.0.2

Published

Runtime-neutral HTTP model (request/response/status/method/error) built from scratch on the plgg framework — the shared base of plgg-server and plgg-fetch

Readme

plgg-http

UNSTABLE - Experimental study work. Part of the plgg monorepo.

The runtime-neutral HTTP model built from scratch on plgg — pure data and pure builders for requests, responses, statuses, methods, and the HTTP failure vocabulary. No node:http, no fetch, no DOM: just the wire vocabulary, shared by both plgg-server (which adds the Web/Routing/View layer and the native request/response seam) and plgg-fetch (which adds the typed fetch client). The only runtime dependency is plgg.

Why this package exists

plgg-server and plgg-fetch are symmetric peers — both speak the same HTTP model. Originally plgg-fetch imported that model from plgg-server, but a peer importing a peer violates the repo's dependency doctrine (peers depend only on plgg core and shared lower layers, never on each other). The resolution is to extract the shared model below both:

plgg ── plgg-http ─┬─ plgg-server
                   └─ plgg-fetch

This is the inverse of the plgg-router/plgg-server Segment decision, and the rule it completes: parallel-define small clones (~a screenful); extract-below large shared vocabularies. The HTTP model is large and identical on both sides, so it gets one home here rather than being cloned.

The model

| Concern | Type / helpers | |--------|----------------| | HTTP method | Method (Box union) · METHODS · isMethod · asMethod | | status code | HttpStatus = Box<"HttpStatus", number> · isHttpStatus · asHttpStatus · statusOf | | request | HttpRequest (pure data) · withParams · getHeader · getQuery · getParam · getBytes | | response | HttpResponse · ResponseBody · textResponse · htmlResponse · jsonResponse · bytesResponse · streamResponse · redirectResponse · bytesBody · streamBody | | failure | HttpError (Box union) · constructors (notFound/badRequest/unauthorized/forbidden/methodNotAllowed/unsupported/statusError/internalError) · matchers (notFound$/…) · httpErrorToResponse |

Everything is pure plgg data: lookups are Option, validation is Result, unions are Box, and failures are values matched by name (notFound$()), never by tag string. There are no platform globals — the package imports safely on a server, in a browser, or under SSR.

Conventions

  • as / any / ts-ignore are prohibited (see root CLAUDE.md); unknown inputs are narrowed with plgg type guards, Option, and Result.
  • After editing plgg core, run npm run build in packages/plgg or this package won't see new exports (the dependency is a symlinked file: dist).