Skip to content

Commit

Permalink
added instructions regarding running the examples
Browse files Browse the repository at this point in the history
  • Loading branch information
thlorenz committed Oct 7, 2012
1 parent 6f4442c commit 8376a14
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 2 deletions.
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down Expand Up @@ -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

Expand Down
37 changes: 37 additions & 0 deletions examples/Readme.md
Original file line number Diff line number Diff line change
@@ -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.