• Version 1.1.0
  • Published
  • 22.2 kB
  • No dependencies
  • MIT license


npm i ssestream
yarn add ssestream
pnpm add ssestream


Send Server-Sent Events with a stream



class SseStream

class SseStream extends Transform {}
  • Transforms "messages" to W3C event stream content. See A message is an object with one or more of the following properties: - data (String or object, which gets turned into JSON) - event - id - retry - comment

    If constructed with a HTTP Request, it will optimise the socket for streaming. If this stream is piped to an HTTP Response, it will set appropriate headers.


constructor(req?: IncomingMessage);

    method pipe

    pipe: <T extends unknown>(destination: T, options?: { end?: boolean }) => T;

      method writeMessage

      writeMessage: (
      message: Message,
      encoding?: string,
      cb?: (error: Error | null | undefined) => void
      ) => boolean;

        Type Aliases

        type HeaderStream

        type HeaderStream = NodeJS.WritableStream & WriteHeaders;

          Package Files (1)

          Dependencies (0)

          No dependencies.

          Dev Dependencies (7)

          Peer Dependencies (0)

          No peer dependencies.


          To add a badge like this badgeto your package's README, use the codes available below.

          You may also use to create a custom badge linking to

          • Markdown
          • HTML
            <a href=""><img src="" alt=""></a>