Skip to content

Commit

Permalink
more examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictarr committed May 5, 2013
1 parent 5deba58 commit 21ffc0e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,30 @@ function log () {
}
```

## stopping early

because this module uses pull-streams, it's lazy,
so you can do queries like the following:

``` js
//find the first package.json in a parent directory.
glob('.../package.json').pipe(pull.take(1)).pipe(log())
```

And you will retrive only the first item, and _will
not do any extra IO_. This is hugely useful when
doing a large traversal...

## collect node_module tree

``` js
glob('**/node_modules/*/package.json')
.pipe(pull.collect(function (e, arr) {
console.log(arr)
})

```
## License
MIT

0 comments on commit 21ffc0e

Please sign in to comment.