3.0.0 (2024-10-19)
⚠ BREAKING CHANGES
- The parser now takes an object of callbacks instead of an
onParse
callback. This means you do not have to check the type of the event in theonEvent
callback, but instead provide separate callbacks for each event type. - The
ParsedEvent
type has been renamed toEventSourceMessage
and thetype
attribute has been removed. - The
EventSourceCallback
type has been removed in favor of theParserCallbacks
interface. - The
ReconnectInterval
type has been removed in favor of providing the interval directly to theonRetry
callback. - The
ParseEvent
type has been removed in favor of providing separate callbacks for each event type. - The parser has been rewritten to be more specification compliant. Certain rare edge cases may now be handled differently. Mixed CRLF and LF line endings will now be handled correctly.
retry
fields now have to be completely valid integers to be parsed.
Features
Migration guide
See migration guide: https://github.com/rexxars/eventsource-parser/blob/main/MIGRATE-v3.md
This release is also available on: