Socket
Socket
Sign inDemoInstall

@sanity/eventsource

Package Overview
Dependencies
4
Maintainers
39
Versions
561
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @sanity/eventsource

EventSource polyfill for browser and node.js


Version published
Weekly downloads
263K
decreased by-2.88%
Maintainers
39
Install size
383 kB
Created
Weekly downloads
 

Changelog

Source

5.0.1 (2023-09-28)

Bug Fixes

  • deps: update dependency @types/event-source-polyfill to v1.0.2 (bb87c96)
  • deps: update dependency @types/eventsource to v1.1.12 (#39) (e312938)

Readme

Source

@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'

Release new version

Run "CI & Release" workflow. Make sure to select the main branch and check "Release new version".

Semantic release will only release on configured branches, so it is safe to run release on any branch.

License

MIT © Sanity.io

Keywords

FAQs

Last updated on 28 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc