Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stagas/fun-stream
functional streams decorator
https://github.com/stagas/fun-stream
Last synced: 14 days ago
JSON representation
functional streams decorator
- Host: GitHub
- URL: https://github.com/stagas/fun-stream
- Owner: stagas
- Created: 2013-05-23T10:35:07.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-05-23T11:15:52.000Z (over 11 years ago)
- Last Synced: 2024-04-08T15:44:49.769Z (7 months ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fun-stream
functional streams decorator
## Example
```js
var fun = require('fun-stream');
var Stream = require('stream');function createStream(){
var stream = new Stream;
stream.readable = truevar count = 0;
var interval = setInterval(function(){
stream.emit('data', count);
if (5 == ++count) {
stream.emit('end');
clearInterval(interval);
}
}, 1000);return stream;
}var stdout = fun(process.stdout);
var stream = fun(createStream());stdout(stream);
```## License
MIT