# mux-memo

> A memoized mux-demux stream connection

Latest version **0.1.2** (published 2012-12-03) · 0 weekly downloads

## Install

```sh
npm install mux-memo
pnpm add mux-memo
yarn add mux-memo
bun add mux-memo
```

## 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.1.2 |
| Published | 2012-12-03 |
| First published | 2012-11-22 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Raynos |
| Maintainers | raynos |

## Links

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

## Dependencies (3)

- [mux-demux](https://npm.io/package/mux-demux.md) ~3.3.6
- [individual](https://npm.io/package/individual.md) ~0.1.0
- [sockjs-stream](https://npm.io/package/sockjs-stream.md) ~0.1.2

## Recent versions

- 0.1.2 (latest) — 2012-12-03
- 0.1.1 — 2012-11-22
- 0.1.0 — 2012-11-22

## README

# mux-memo

A memoized mux-demux stream connection

## Motivation

There are a few technical issues with websocket limitations in
    the browser. Namely the fact browsers can only open two
    websocket connections to the same domain.

Even worse then that. SockJS uses two websockets to do it's
    communication so you can only open one sockjs stream
    connection per domain.

To get around this issue cleanly it's easiest to use a library
    that allows you to open up a cached stream connection per
    domain so you never get into this issue.

There is a small issue with having a shared connection to a
    domain which is the data gets all messed up and mixed
    together. To get around this we should multiplex that
    connection by default (with mux-demux).

## Example

MuxMemo when given an uri returns you a `MuxDemux` instance and
    garantuees that you can have don't open up two sockjs
    streams to the same domain.

```js
var MuxMemo = require("mux-memo")
    , WriteStream = require("write-stream")

var mdm1 = MuxMemo("//signalchannel.co/sock")
    , mdm2 = MuxMemo("//signalchannel.co/sock")

var stream1 = mdm1.createStream("/v1/echo/x/12")
    , stream2 = mdm1.createStream("/v1/echo/x/13")

stream2.pipe(WriteStream(function (chunk) {
    console.log("got data!", chunk)
}))

stream1.write("hello world!")
```

## Installation

`npm install mux-memo`

## Contributors

 - Raynos

## MIT Licenced

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