Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

better-sse

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better-sse - npm Package Versions

2

0.14.1

Diff

Changelog

Source

0.14.1 - 2024-10-27

Changed

  • Update links to point to new documentation website.
mwid
published 0.14.0 •

Changelog

Source

0.14.0 - 2024-10-18

Fixed

  • Fixed default state type when creating sessions and channels with createSession and createChannel being set to unknown instead of DefaultSessionState and DefaultChannelState, respectively.
  • Fixed package directly exporting a single object containing exports, breaking named imports when using ESModules, and instead dual-export two separate builds to support both ESM and CJS.

Removed

  • Dropped support for Node 17 and below.
mwid
published 0.13.0 •

Changelog

Source

0.13.0 - 2024-08-23

Added

  • Added the ability to set an initial value for the state property in the Session and Channel constructor options objects.

Removed

  • Removed constraints that enforced that State generics passed to Session and Channel extend from Record<string, unknown>.
mwid
published 0.12.1 •

Changelog

Source

0.12.1 - 2024-05-24

Fixed

  • Fixed types for channel and session emitted event names.
mwid
published 0.12.0 •

Changelog

Source

0.12.0 - 2024-05-10

Added

mwid
published 0.11.0 •

Changelog

Source

0.11.0 - 2024-02-08

Added

  • Added the SseError custom error object that wraps all thrown errors.

Changed

  • Update the Session#push method to throw if the session is not connected.

Fixed

  • Fixed session not detecting a response stream disconnect.
mwid
published 0.10.0 •

Changelog

Source

0.10.0 - 2023-09-28

Added

  • Added the Session#batch method that can be used to batch multiple events into a single transmission over the wire.
  • Added the EventBuffer class that can be used to write raw spec-compliant SSE fields into a text buffer that can be sent directly over the wire.

Deprecated

  • Deprecate the Session .event, .data, .id, .retry, .comment, .dispatch and .flush methods in favour of using event buffers instead.
mwid
published 0.9.0 •

Changelog

Source

0.9.0 - 2023-08-14

Added

  • Added the ability to type the state property of sessions registered with a Channel via an optional second generic argument to the Channel constructor.
  • Added the DefaultChannelState interface that may be used via module augmentation to alter the default channel state type for all channels.

Changed

mwid
published 0.8.0 •

Changelog

Source

0.8.0 - 2022-06-02

Added

  • Added an internal data buffer to Session that buffers written data internally until it is flushed to the client using the new Session#flush method.
  • Added the Pragma, X-Accel-Buffering headers and add additional values to the Cache-Control default header to further disable all forms of caching.
  • Added support for supplying the Node HTTP/2 compatibility API Http2ServerRequest and Http2ServerResponse objects to the Session constructor req and res parameters, respectively.

Changed

  • Update the Session#event, Session#data, Session#id, Session#retry and Session#comment methods to write to the internal data buffer instead of sending the field data over the wire immediately.
  • Update the Session#dispatch method to only write a newline (and to the internal data buffer) and not flush the written data to the client.
  • Update the Channel#broadcast method to generate its own custom event ID and thus add it as an additional argument to its broadcast event callback function.
  • Update the Channel#register and Channel#deregister to not do anything if the channel is already registered or deregistered, respectively.
  • Update the Session constructor options header field to overwrite conflicting default headers instead of being ignored.
  • Update auto-generated event IDs to be guaranteed to be a cryptographically unique string instead of a pseudorandomly generated string of eight characters.

Fixed

  • Fixed the Channel session-disconnected being fired after instead of before the session is deregistered.

Removed

  • Removed the ability to pass null to Session#id. Give no arguments at all instead.
mwid
published 0.7.1 •

Changelog

Source

0.7.1 - 2022-01-11

Fixed

  • Removed type-declarations generated from unit testing files.
2
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc