Permalink
Browse files

added instructions regarding running the examples

  • Loading branch information...
1 parent 6f4442c commit 8376a1473e4f51be335462b5ad2a02b44bf9af43 @thlorenz committed Oct 7, 2012
Showing with 62 additions and 2 deletions.
  1. +25 −2 README.md
  2. +37 −0 examples/Readme.md
View
@@ -36,7 +36,8 @@ Meant to be one of the recursive versions of [fs](http://nodejs.org/docs/latest/
- [More Examples](#more-examples)
- [stream api](#stream-api)
- [stream api pipe](#stream-api-pipe)
- - [callback api](#callback-api)
+ - [grep](#grep)
+ - [using callback api](#using-callback-api)
- [tests](#tests)
@@ -185,11 +186,33 @@ readdirp(
);
```
+Try more examples by following [instructions](https://github.com/thlorenz/readdirp/blob/master/examples/Readme.md)
+on how to get going.
+
## stream api
+[stream-api.js](https://github.com/thlorenz/readdirp/blob/master/examples/stream-api.js)
+
+Demonstrates error and data handling by listening to events emitted from the readdirp stream.
+
## stream api pipe
-## callback api
+[stream-api-pipe.js](https://github.com/thlorenz/readdirp/blob/master/examples/stream-api-pipe.js)
+
+Demonstrates error handling by listening to events emitted from the readdirp stream and how to pipe the data stream into
+another destination stream.
+
+## grep
+
+[grep.js](https://github.com/thlorenz/readdirp/blob/master/examples/grep.js)
+
+Very naive implementation of grep, for demonstration purposes only.
+
+## using callback api
+
+[callback-api.js](https://github.com/thlorenz/readdirp/blob/master/examples/callback-api.js)
+
+Shows how to pass callbacks in order to handle errors and/or data.
## tests
View
@@ -0,0 +1,37 @@
+# readdirp examples
+
+## How to run the examples
+
+Assuming you installed readdirp (`npm install readdirp`), you can do the following:
+
+1. `npm explore readdirp`
+2. `cd examples`
+3. `npm install`
+
+At that point you can run the examples with node, i.e., `node grep`.
+
+## stream api
+
+[stream-api.js](https://github.com/thlorenz/readdirp/blob/master/examples/stream-api.js)
+
+Demonstrates error and data handling by listening to events emitted from the readdirp stream.
+
+## stream api pipe
+
+[stream-api-pipe.js](https://github.com/thlorenz/readdirp/blob/master/examples/stream-api-pipe.js)
+
+Demonstrates error handling by listening to events emitted from the readdirp stream and how to pipe the data stream into
+another destination stream.
+
+## grep
+
+[grep.js](https://github.com/thlorenz/readdirp/blob/master/examples/grep.js)
+
+Very naive implementation of grep, for demonstration purposes only.
+
+## using callback api
+
+[callback-api.js](https://github.com/thlorenz/readdirp/blob/master/examples/callback-api.js)
+
+Shows how to pass callbacks in order to handle errors and/or data.
+

0 comments on commit 8376a14

Please sign in to comment.