Socket
Book a DemoInstallSign in
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).

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
4
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

ton-connect

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.