@sanity/eventsource
TypeScript icon, indicating that this package has built-in type declarations

5.0.2 • Public • Published

@sanity/eventsource

npm stat npm version gzip size size

Meta-package to make browsers and Node use different EventSource polyfills

npm install @sanity/eventsource

Usage

import polyfilledEventSource from '@sanity/eventsource'

The polyfill adds support for auth headers, which isn't part of the EventSource spec.

In NodeJS environments it's the implementation from eventsource package. While browsers use event-source-polyfill.

Forcing a specific implementation

To get the browser implementation, no matter how your bundler or runtime understands package.json exports, you can use the following:

import polyfilledEventSource from '@sanity/eventsource/browser'

To force the Node implementation, use the following:

import polyfilledEventSource from '@sanity/eventsource/node'

License

MIT © Sanity.io

/@sanity/eventsource/

    Package Sidebar

    Install

    npm i @sanity/eventsource

    Weekly Downloads

    247,535

    Version

    5.0.2

    License

    MIT

    Unpacked Size

    6.96 kB

    Total Files

    8

    Last publish

    Collaborators

    • joan_miralles_paez
    • jwoods-sanity
    • armandocerna
    • daniel.malmer
    • jordanl17
    • tambet
    • jtpetty
    • drewsanity
    • refiito
    • sergeisarviro
    • ash
    • indrek.karner
    • cngonzalez-sanity
    • rdunk
    • rneatherway-sanity
    • ricokahler
    • pedro-sanity
    • jonabc
    • kenjonespizza
    • pauloborgesf
    • binoy14
    • simen.svale
    • svirs
    • josh_sanity_io
    • joneidejohnsen
    • nina.andal
    • rankers
    • snorreeb
    • mattcraig
    • vincentquigley
    • stipsan
    • michael-sanity
    • rubioz
    • tonina
    • ritasdias
    • simeonsanity
    • kmelve
    • bjoerge
    • rexxars
    • skogsmaskin
    • robinpyon
    • mariuslundgard
    • sanity-io
    • evenw
    • radhe_sanity
    • rbotten
    • judofyr
    • obliadp
    • dcilke
    • fredcarlsen
    • hermanw
    • sgulseth
    • atombender