# streamify

> Streamify helps you easily provide a streaming interface for code.

Latest version **1.0.0** (published 2018-09-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install streamify
pnpm add streamify
yarn add streamify
bun add streamify
```

## 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.0 |
| Published | 2018-09-13 |
| First published | 2012-07-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 0 |
| Unpacked size | 8.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 52 |
| Author | fent |
| Maintainers | fent |
| Keywords | stream, input, output, api |

## Links

- npm: https://www.npmjs.com/package/streamify
- Repository: https://github.com/fent/node-streamify
- Homepage: https://github.com/fent/node-streamify#readme
- Issues: https://github.com/fent/node-streamify/issues
- npm.io page: https://npm.io/package/streamify

## 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

- 1.0.0 (latest) — 2018-09-13
- 0.3.1 — 2018-03-24
- 0.3.0 — 2017-10-25
- 0.2.9 — 2017-08-10
- 0.2.8 — 2017-03-02
- 0.2.7 — 2016-12-05
- 0.2.6 — 2016-07-05
- 0.2.5 — 2015-09-27
- 0.2.4 — 2014-06-04
- 0.2.3 — 2014-02-22
- 0.2.2 — 2013-09-08
- 0.2.1 — 2013-08-25
- 0.2.0 — 2013-03-19
- 0.1.2 — 2012-11-22
- 0.1.1 — 2012-07-18
- … 1 more at https://npm.io/package/streamify/versions

## README

# node-streamify

Streamify helps you easily provide a streaming interface for your code.

[![Build Status](https://secure.travis-ci.org/fent/node-streamify.svg)](http://travis-ci.org/fent/node-streamify)
[![Dependency Status](https://david-dm.org/fent/node-streamify.svg)](https://david-dm.org/fent/node-streamify)
[![codecov](https://codecov.io/gh/fent/node-streamify/branch/master/graph/badge.svg)](https://codecov.io/gh/fent/node-streamify)

# Usage

```js
const streamify = require('streamify');
const request   = require('request');

exports.doSomething = () => {
  let stream = streamify();

  request(url1, (err, res, body) => {
    // Do something with `body`.

    // Once the actual stream you want to return is ready,
    // call `stream.resolve()`.
    stream.resolve(request(url2));
  });

  // Your function can return back a stream!!
  return stream;
}

// Because `doSomething()` returns a stream, it can be piped.
exports.doSomething().pipe(anotherStream);
```


# API
### streamify([options])

Returns an instance of a stream. `options` can be

* `readable` - Defaults to `true`.
* `writable` - Defaults to `true`.

### Stream#resolve(stream)

Must be called only once when the actual stream you are proxying to becomes available after an asynchronous operation.

### Stream#unresolve()

Can be used to unbind a a resolved stream to later call `resolve()` again.

### Stream#addSource(stream)

Add a source readable stream.

### Stream#removeSource()

Remove previously added source stream.

### Stream#addDest(stream)

Add a destination writable stream.

### Stream#removeDest()

Remove a previously added destination stream.


# Install

    npm install streamify


# Tests
Tests are written with [mocha](https://mochajs.org)

```bash
npm test
```

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