# engine.io-stream

> Make engine.io a valid node stream

Latest version **0.4.3** (published 2014-01-13) · 0 weekly downloads

## Install

```sh
npm install engine.io-stream
pnpm add engine.io-stream
yarn add engine.io-stream
bun add engine.io-stream
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.3 |
| Published | 2014-01-13 |
| First published | 2012-12-07 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 44 |
| Author | Raynos |
| Maintainers | raynos, shtylman |

## Links

- npm: https://www.npmjs.com/package/engine.io-stream
- Repository: https://github.com/Raynos/engine.io-stream
- Issues: https://github.com/Raynos/engine.io-stream/issues
- npm.io page: https://npm.io/package/engine.io-stream

## Dependencies (2)

- [engine.io](https://npm.io/package/engine.io.md) 0.7.12
- [engine.io-client](https://npm.io/package/engine.io-client.md) 0.7.12

## Recent versions

- 0.4.3 (latest) — 2014-01-13
- 0.4.2 — 2013-11-12
- 0.4.1 — 2013-08-12
- 0.4.0 — 2013-08-03
- 0.3.2 — 2013-07-09
- 0.3.1 — 2013-06-13
- 0.3.0 — 2013-05-10
- 0.2.1 — 2013-02-19
- 0.2.0 — 2012-12-31
- 0.1.0 — 2012-12-07

## README

# engine.io-stream

simple interface to engine.io via node streams

The API is pretty much the same as [shoe](https://github.com/substack/shoe)

## Example Client

```js
var engine = require("engine.io-stream")

// attach to an engine.io server at url '/numbers'
var stream = engine("/numbers")

stream.on('data', function(data) {
    console.log(data)
    stream.write('ack')
})
```

## Example Server

```js
var http = require("http")
var EngineServer = require("engine.io-stream")

// engines need to attach to server instances (see below)
var server = http.createServer(...)

var engine = EngineServer(function(stream) {
    // send back some numbers, you know...for fun
    var iv = setInterval(function () {
        stream.write(String(Math.floor(Math.random() * 2)))
    }, 250)

    stream.once("end", function () {
        clearInterval(iv)
    })

    stream.pipe(process.stdout, { end : false })
})

// expose the engine instance at this url
engine.attach(server, "/numbers")

server.listen(8080, function() {
    console.log("Listening on port 8080")
})
```

## Installation

`npm install engine.io-stream`

## Contributors

 - Raynos
 - shtylman
 - juliangruber
 - hij1nx

## Licence
MIT

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