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

hono-typedstream

v0.1.3

Published

<img height="300" align="right" alt="image" src="https://github.com/user-attachments/assets/fcff202f-79bf-4028-a54e-5f5e8f9e3e4c" />

Readme

hono-typedstream

hono-typedstream is a lightweight helper that lets Hono handlers stream JSON values line by line while keeping end-to-end TypeScript safety. The server utility turns a ReadableStream or AsyncGenerator into a Hono response, and the client utilities reconstruct each JSON line as typed objects.

Features

  • Type-safe streaming: Share the same generic type between server and client thanks to TypedResponse support.
  • Simple API surface: Call typedStream on the server and receiveTypedStream on the client—no manual plumbing required.
  • Built for Hono: Leverages streamText, works smoothly with testClient, and fits naturally into existing Hono apps.

Installation

npm

https://www.npmjs.com/packages/hono-typedstream

npm install hono-typedstream # npm
yarn add hono-typedstream # yarn
pnpm add hono-typedstream # pnpm
bun add hono-typedstream # bun
deno add npm:hono-typedstream # deno

jsr

The package is published to jsr.io/@ns/hono-typedstream.

npx jsr add @ns/hono-typedstream # npm
yarn dlx jsr add @ns/hono-typedstream # yarn
pnpm dlx jsr add @ns/hono-typedstream # pnpm
bunx jsr add @ns/hono-typedstream # bun
deno add jsr:@ns/hono-typedstream # deno
import { typedStream } from 'hono-typedstream'
import { receiveTypedStream } from 'hono-typedstream/client'

Usage

Server: typedStream

typedStream accepts a ReadableStream or AsyncGenerator, serializes each chunk as JSON, and streams it to the client.

import { Hono } from 'hono'
import { typedStream } from 'hono-typedstream'

const app = new Hono()

app.get('/events', c =>
  typedStream(c, async function* () {
    yield { message: 'Hello' }
    yield { message: 'World' }
  })
)

// You can provide a ReadableStream directly
app.get('/numbers', c => {
  const stream = new ReadableStream<number>({
    start(controller) {
      for (let i = 0; i < 5; i++) controller.enqueue(i)
      controller.close()
    },
  })
  return typedStream(c, stream)
})

export type AppType = typeof app

Client: receiveTypedStream

import { hc } from 'hono/client'
import { receiveTypedStream } from 'hono-typedstream/client'
import type { AppType } from './server.ts'

const client = hc<AppType>('/')

const res = await client.events.$get()

for await (const chunk of receiveTypedStream(res)) {
  console.log(chunk.message)
}