# event-source-any-where

> A polyfill for http://www.w3.org/TR/eventsource/

Latest version **1.0.5** (published 2018-06-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install event-source-any-where
pnpm add event-source-any-where
yarn add event-source-any-where
bun add event-source-any-where
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2018-06-11 |
| First published | 2016-11-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 44.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Shinichi52 |
| Maintainers | le.bui |
| Keywords | sse, server sent events, eventsource, event-source, polyfill, react-sse, react-event-source |

## Links

- npm: https://www.npmjs.com/package/event-source-any-where
- Repository: https://github.com/Shinichi52/EventSource
- Issues: https://github.com/Shinichi52/EventSource/issues
- npm.io page: https://npm.io/package/event-source-any-where

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.0.5 (latest) — 2018-06-11
- 1.0.4 — 2017-02-28
- 1.0.3 — 2016-11-23
- 1.0.2 — 2016-11-22
- 1.0.1 — 2016-11-15
- 1.0.0 — 2016-11-15

## README

#React Native Event Source
Base On: https://github.com/eohland/EventSource


#install for node,react-native:
    npm install event-source-any-where --save
#install for HTML:
    <script src="https://github.com/Shinichi52/EventSource/blob/master/eventsource.min.js"></script>

# Using On React Navtive, NodeJS (not require in html5)
    require('event-source-any-where'); // for overwrite EventSource

# Using EventSource
```javascript
    let _consumer = new EventSourceEx(YourUrl);

    // add event
    _consumer.addEventListener(YourKey, Callback);
    // remove event
    _consumer.removeEventListener(YourKey, Callback);
    // close connection
    _consumer.close();
```
    
#Example:
```javascript
        require('event-source-any-where');
        this._consumer = new EventSourceEx(CONFIG.urlAuth + CONFIG.serviceConsumer);
        this._consumer.addEventListener("message", this.onReceiveMessage);
        this._consumer.addEventListener("error", this.onConnectError);
```

---
_Source: https://npm.io/package/event-source-any-where · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
