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

@ahoo-wang/fetcher-eventstream

v5.0.1

Published

Server-Sent Events (SSE) support for Fetcher HTTP client with native LLM streaming API support. Enables real-time data streaming and token-by-token LLM response handling.

Readme

@ahoo-wang/fetcher-eventstream

把 Server-Sent Events 解析为 Web Streams,并通过异步迭代消费类型化 JSON 事件。 HTTP 响应是增量数据而不是完整正文时使用该包。

安装

pnpm add @ahoo-wang/fetcher @ahoo-wang/fetcher-eventstream

Peer 依赖为 @ahoo-wang/fetcher。导入该包会给平台 Response 类型和原型增加事件流 辅助 API。

示例

import '@ahoo-wang/fetcher-eventstream';
import { Fetcher } from '@ahoo-wang/fetcher';

interface Progress {
  percent: number;
}

const response = await new Fetcher().get('/jobs/42/events');
const events = response.requiredJsonEventStream<Progress>();

for await (const event of events) {
  console.log(event.data.percent);
}

核心能力

  • Response 内容类型识别和 optional/required 流辅助 API。
  • 通过原生 TransformStream 阶段解析 SSE 行与事件。
  • 类型化 JSON 事件流与协议专用结束检测。
  • 面向原始与 JSON SSE 流的 Fetcher 结果提取器。
  • 保留源 Response 的转换错误。

文档

English · 许可证