# multisource-stream

> A readable stream that accepts multiple sources.

Latest version **0.0.3** (published 2014-01-06) · 0 weekly downloads

## Install

```sh
npm install multisource-stream
pnpm add multisource-stream
yarn add multisource-stream
bun add multisource-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.0.3 |
| Published | 2014-01-06 |
| First published | 2013-09-27 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Morhaus |
| Maintainers | morhaus |
| Keywords | multisource, stream |

## Links

- npm: https://www.npmjs.com/package/multisource-stream
- Repository: git@github.com:morhaus/multisource-stream
- Homepage: https://github.com/morhaus/multisource-stream
- Issues: https://github.com/morhaus/multisource-stream/issues
- npm.io page: https://npm.io/package/multisource-stream

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) 2.x

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2014-01-06
- 0.0.2 — 2013-12-01
- 0.0.1 — 2013-09-27

## README

# Multisource Stream

A readable stream that accepts an arbitrary number of sources, which can start from any offset.

## Examples
```
var multi = new Multisource();
var source1 = multi.from(0);
var source2 = multi.from(6);
source2.write("World !");
multi.read(); // => null
source1.write("Hello ");
multi.read().toString(); // => "Hello World !"
```
```
var multi = new Multisource();
multi.from(0).write("foo");
multi.from(3).write("bar");
multi.read().toString(); // => "foobar"
```
```
var request = require('request');
var multi = new Multisource();

request('http://www.host.com/archive.zip', { headers: { 'Range': 'bytes=0-499' } }).pipe(multi.from(0));
request('http://www.host.com/archive.zip', { headers: { 'Range': 'bytes=500-999' } }).pipe(multi.from(500));
```

# Class: Multisource

## multisource.from(offset, [options])

* `offset` {Number}
* `options` {Object} Directly passed to the Source constructor
* return {Source} A stream.Duplex which writes to the multisource stream from an offset

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