Skip to content

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

License

Notifications You must be signed in to change notification settings

jaw977/callbag-from-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •