callbag-from-stream

1.0.0 • Public • Published

callbag-from-stream

Convert a readable stream (or any EventEmitter with data / end / error events) to a callbag listenable source.

npm install callbag-from-stream

example

Create and observe a source callbag created from a file's readable stream:

const fs = require('fs');
const fromStream = require('callbag-from-stream');
const observe = require('callbag-observe');
 
const stream = fs.createReadStream('LICENSE.txt',{encoding:'utf8'});
const source = fromStream(stream);
observe(x => console.log(x))(source);

/callbag-from-stream/

    Package Sidebar

    Install

    npm i callbag-from-stream

    Weekly Downloads

    6

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    3.83 kB

    Total Files

    6

    Last publish

    Collaborators

    • jaw977