Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yorkie/node-stream-simplify
little utility for simplifying your stream, programming more like callback style.
https://github.com/yorkie/node-stream-simplify
Last synced: 5 days ago
JSON representation
little utility for simplifying your stream, programming more like callback style.
- Host: GitHub
- URL: https://github.com/yorkie/node-stream-simplify
- Owner: yorkie
- Created: 2013-12-23T11:00:57.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-19T16:20:36.000Z (over 10 years ago)
- Last Synced: 2024-10-19T20:12:28.302Z (24 days ago)
- Language: JavaScript
- Size: 129 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# node-stream-simplify
Little utility for simplifying your stream, programming more like callback style.
Sometimes, you just wanna send a simple net data to the service, then you provide a callback that receive the data. This module could help you to do then.
The difference is more like the `fs.read` and `fs.createReadStream`, so you could use my module to monitor `fs.read` by using `fs.createReadStream`, actually `stream-simplify` should be used for streams that only provide an event-drivern api, like `net` or `tls`.
### Installation
```
$ npm install stream-simplify
```### Example
```js
simplify(fs.createReadStream('./example.txt'), option, function(err, data) {
// TODO
})
```### Option
* timeout: the max secound that callback must be invoked.
* depth: the time that you wanna triggered the `data`event.
### License
MIT