Commit 3c7409c9ab2a95a9f88a53a335045a17e5ae0f7c
README
Dominic Tarr committed on 5/5/2013, 12:10:13 AMParent: a0c52d31f9701a38606eec66c780492f827ef46f
Files changed
README.md | changed |
README.md | ||
---|---|---|
@@ -1,15 +1,33 @@ | ||
1 | 1 | # pull-stream |
2 | 2 | |
3 | -Experimental Minimal Pipeable Pull-stream | |
3 | +Minimal Pipeable Pull-stream | |
4 | 4 | |
5 | 5 | In [classic-streams](https://github.com/joyent/node/blob/v0.8/doc/api/stream.markdown), |
6 | 6 | streams _push_ data to the next stream in the pipeline. |
7 | 7 | In [new-streams](https://github.com/joyent/node/blob/v0.10/doc/api/stream.markdown), |
8 | 8 | data is pulled out of the source stream, into the destination. |
9 | 9 | |
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. | |
11 | 12 | |
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 | + | |
12 | 30 | ## Examples |
13 | 31 | |
14 | 32 | What if implementing a stream was this simple: |
15 | 33 |
Built with git-ssb-web