All Projects → fent → node-streamify

fent / node-streamify

Licence: MIT License
Streamify helps you easily provide a streaming interface for your code.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to node-streamify

playercast
Cast to media player and control playback remotely.
Stars: ✭ 46 (-9.8%)
Mutual labels:  stream
wsa
WSA(Websocket Streaming Agent) is a stream server target for mp4/h264 streaming over websocket
Stars: ✭ 35 (-31.37%)
Mutual labels:  stream
lectures
My free and open source tutorials/books on JS and Java 📖 🌹📚
Stars: ✭ 35 (-31.37%)
Mutual labels:  stream
vidi
<video> playback simplified
Stars: ✭ 31 (-39.22%)
Mutual labels:  stream
ear-pipe
Pipe audio streams to your ears
Stars: ✭ 17 (-66.67%)
Mutual labels:  stream
canvas-cast
Cast any <canvas> element to an LED Matrix over WebSockets with an Arduino/ESP8266.
Stars: ✭ 39 (-23.53%)
Mutual labels:  stream
sms
rtmp server and super media server whith golang.
Stars: ✭ 65 (+27.45%)
Mutual labels:  stream
chromecast-api
📺 Chromecast Node.js module
Stars: ✭ 122 (+139.22%)
Mutual labels:  stream
manifold-cljs
Manifold implementation in Clojurescript
Stars: ✭ 45 (-11.76%)
Mutual labels:  stream
stream
Stream API for Go.
Stars: ✭ 43 (-15.69%)
Mutual labels:  stream
pcap-processor
Read and process pcap files using this nifty tool
Stars: ✭ 36 (-29.41%)
Mutual labels:  stream
TLightFileStream
Implements a lightweight, high-performance, non-allocating advanced-record-based wrapper around the SysUtils file handling routines as an alternative to Classes.TFileStream.
Stars: ✭ 21 (-58.82%)
Mutual labels:  stream
QuickImageFX
Simplifying image manipulation using GDI, Graphics32, OpenCV or Vampyre Imaging libraries
Stars: ✭ 41 (-19.61%)
Mutual labels:  stream
WebRTCCTV
WebRTCCTV is a signaling server & webapp able to stream from RTSP cameras using WebRTC
Stars: ✭ 32 (-37.25%)
Mutual labels:  stream
psql-streamer
Stream database events from PostgreSQL to Kafka
Stars: ✭ 37 (-27.45%)
Mutual labels:  stream
vue-virtual-stream
Simple vue-virtualized package for Vue.js
Stars: ✭ 16 (-68.63%)
Mutual labels:  stream
python-zipstream
Like Python's ZipFile module, except it works as a generator that provides the file in many small chunks.
Stars: ✭ 117 (+129.41%)
Mutual labels:  stream
TogetherStream
A social and synchronized streaming experience
Stars: ✭ 16 (-68.63%)
Mutual labels:  stream
Stream-to-VLC
Tampermonkey script that uses a custom URI scheme to view streams in VLC.
Stars: ✭ 20 (-60.78%)
Mutual labels:  stream
RoadToTop50-Methodology
Methodology notes for web and infrastructure (Windows/Linux) testing.
Stars: ✭ 32 (-37.25%)
Mutual labels:  stream

node-streamify

* Abandoned *

Use a passthrough stream

import { PassThrough } from 'stream';

export myCoolFunction = () => {
  let stream = new PassThrough();
  asyncFunc((err, otherStream) => {
    otherStream.pipe(stream);
  });
}

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

Dependency Status codecov

Usage

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

npm test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].