git ssb

2+

Dominic / pull-stream



Commit 3c7409c9ab2a95a9f88a53a335045a17e5ae0f7c

README

Dominic Tarr committed on 5/5/2013, 12:10:13 AM
Parent: a0c52d31f9701a38606eec66c780492f827ef46f

Files changed

README.mdchanged
README.mdView
@@ -1,15 +1,33 @@
11 # pull-stream
22
3-Experimental Minimal Pipeable Pull-stream
3+Minimal Pipeable Pull-stream
44
55 In [classic-streams](https://github.com/joyent/node/blob/v0.8/doc/api/stream.markdown),
66 streams _push_ data to the next stream in the pipeline.
77 In [new-streams](https://github.com/joyent/node/blob/v0.10/doc/api/stream.markdown),
88 data is pulled out of the source stream, into the destination.
99
10-`pull-stream` is a minimal take on pull streams.
10+`pull-stream` is a minimal take on pull streams,
11+optimized for "object" streams, but still supporting text streams.
1112
13+## Quick Example
14+
15+stat some files.
16+
17+``` js
18+pull.values(['file1', 'file2', 'file3'])
19+.pipe(pull.asyncMap(fs.stat))
20+.pipe(pull.collect(function (err, array) {
21+ console.log(array)
22+})
23+```
24+
25+The best thing about pull-stream is that it can be completely lazy.
26+this is perfect for async traversals where you might want to stop early.
27+
28+stat files recursively
29+
1230 ## Examples
1331
1432 What if implementing a stream was this simple:
1533

Built with git-ssb-web