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

@tonconnect/isomorphic-eventsource

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tonconnect/isomorphic-eventsource

This package provides `EventSource` applicable in different environments (browser & NodeJS).

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
32K
increased by1.8%
Maintainers
4
Weekly downloads
 
Created
Source

@tonconnect/isomorphic-eventsource

This package provides EventSource applicable in different environments (browser & NodeJS).

Get started

npm i @tonconnect/isomorphic-eventsource

How to use

Just import the package and use global EventSource constructor:

import '@tonconnect/isomorphic-eventsource';

const eventSourceInstance = new EventSource();

That will work in both browser and NodeJS.

How does it work

This package exports an empty script if bundler creates browser-compatible build. When package is imported in NodeJS environment, it assigns an EventSource imported from the eventsource package to the global variable.

Note that this package doesn't provide an EventSource polyfill for browsers which doesn't support EventSource natively.

Keywords

FAQs

Package last updated on 06 Nov 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc