Update README.md (#60)
Fix minor typo where chained callback is described as "next" when it's expressed as "callback"
This commit is contained in:
parent
73176274e2
commit
0eedd881d4
1 changed files with 3 additions and 3 deletions
|
@ -51,18 +51,18 @@ pack.pipe(process.stdout)
|
|||
|
||||
## Extracting
|
||||
|
||||
To extract a stream use `tar.extract()` and listen for `extract.on('entry', header, stream, callback)`
|
||||
To extract a stream use `tar.extract()` and listen for `extract.on('entry', (header, stream, next) )`
|
||||
|
||||
``` js
|
||||
var extract = tar.extract()
|
||||
|
||||
extract.on('entry', function(header, stream, callback) {
|
||||
extract.on('entry', function(header, stream, next) {
|
||||
// header is the tar header
|
||||
// stream is the content body (might be an empty stream)
|
||||
// call next when you are done with this entry
|
||||
|
||||
stream.on('end', function() {
|
||||
callback() // ready for next entry
|
||||
next() // ready for next entry
|
||||
})
|
||||
|
||||
stream.resume() // just auto drain the stream
|
||||
|
|
Loading…
Reference in a new issue