Back to Explore

rexxars/eventsource-parser

GitHub
3 updates · last 90 days1 watchersOpen source

Last release: 1 week ago

A streaming, source-agnostic JavaScript parser for EventSource and Server-Sent Events (SSE) that you feed with partial or complete chunks to emit parsed messages when an event is complete. Useful as a building block for SSE/EventSource clients and polyfills across browsers, Node.js, and Deno, with callbacks for events, retries, comments, and parse errors.

Project status

  • Actively maintained: the upstream was last pushed on 2026-06-06, and there have been multiple tagged updates since April 2026 (v3.0.7, v3.0.8, v3.1.0).
  • Apparent update cadence: updates arrived relatively close together (v3.0.7 on 2026-04-17, v3.0.8 on 2026-04-19), then about a month later (v3.1.0 on 2026-05-27).

AI summary generated Today

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v3.1.0

    1 week ago

    v3.1.0 introduces a new `maxBufferSize` option to limit how much data the SSE parser will buffer while waiting for line or event terminators. When the limit is exceeded, the parser emits a `ParseError` and transitions into a terminated state, intended to prevent unbounded memory growth from malformed or malicious streams.

    Features
  • v3.0.8

    1 month ago

    Release v3.0.8 focuses on performance, specifically eliminating an O(N^2) behavior when a single SSE event spans many small incoming chunks. The implementation achieves this by changing how partial lines are buffered and processed, avoiding repeated string concatenation. Release notes only mention the performance improvement and do not call out any other behavioral or dependency changes.

  • v3.0.7

    1 month ago

    v3.0.7 delivers a major internal refactor of the SSE parsing loop to achieve a reported ~3.75x throughput improvement, while also downgrading a browserslist node.js declaration to Node 18. The diff also shows additional behavioral changes (not described in the release notes) and multiple packaging, CI, and dev-tooling updates.

  • v3.0.6

    9 months ago

    Release v3.0.6 reintroduces explicit support for Node 18. The code-related changes are limited to project configuration, specifically the Node engine requirement and CI test matrix, with the changelog updated accordingly.

  • v3.0.5

    9 months ago

    v3.0.5 is primarily a TypeScript typing adjustment to align with exact optional property types. The diff also includes additional parsing behavior changes around how carriage returns at chunk boundaries are handled, plus some build and CI/tooling updates.

  • v3.0.3

    11 months ago

    v3.0.3 is presented as a small bug fix release. The documented change is reintroducing legacy exports for the stream module, and the code diff also shows packaging and runtime compatibility adjustments that are not mentioned in the release notes.

    Breaking
  • v3.0.2

    5/14/2025

    v3.0.2 primarily changes how the package is exported/bundled, described in the release notes as dropping a legacy module export and switching to a shared ESM approach. The diff also shows additional packaging and build configuration changes (and multiple devDependency/version bumps) that are not covered in the release notes.

    Breaking
  • v3.0.1

    3/27/2025

    v3.0.1 focuses on parser robustness and performance. The release notes call out an optimized `splitLines` implementation and a clearer runtime error when `createParser()` is called with an invalid `callbacks` argument type.

  • v3.0.0

    10/19/2024

    v3.0.0 is a major API change for eventsource-parser, switching the core `createParser` function to use a callbacks object instead of a single `onParse` callback with discriminated union types. The parser was also rewritten for better spec compliance, including more robust line ending handling and stricter parsing of `retry` values. The release adds support for `onError`, `onComment`, and `onRetry` callbacks as part of the new callback-based architecture.

    BreakingFeatures
  • v2.0.1

    8/7/2024

    v2.0.1 is a small maintenance release focused on packaging. The release notes state it fixes legacy export availability for consumers of the published package.