Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jaw977/callbag-from-stream
Convert a readable stream (EventEmitter with data / end / error events) to a callbag listenable source
https://github.com/jaw977/callbag-from-stream
callbag
Last synced: 3 months ago
JSON representation
Convert a readable stream (EventEmitter with data / end / error events) to a callbag listenable source
- Host: GitHub
- URL: https://github.com/jaw977/callbag-from-stream
- Owner: jaw977
- License: mit
- Created: 2018-02-15T18:04:34.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-15T18:49:39.000Z (almost 7 years ago)
- Last Synced: 2024-10-02T07:28:47.966Z (3 months ago)
- Topics: callbag
- Language: JavaScript
- Size: 3.91 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-callbags - from-stream
README
# 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:
```js
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);
```