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
|
## 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
|
``` js
|
||||||
var extract = tar.extract()
|
var extract = tar.extract()
|
||||||
|
|
||||||
extract.on('entry', function(header, stream, callback) {
|
extract.on('entry', function(header, stream, next) {
|
||||||
// header is the tar header
|
// header is the tar header
|
||||||
// stream is the content body (might be an empty stream)
|
// stream is the content body (might be an empty stream)
|
||||||
// call next when you are done with this entry
|
// call next when you are done with this entry
|
||||||
|
|
||||||
stream.on('end', function() {
|
stream.on('end', function() {
|
||||||
callback() // ready for next entry
|
next() // ready for next entry
|
||||||
})
|
})
|
||||||
|
|
||||||
stream.resume() // just auto drain the stream
|
stream.resume() // just auto drain the stream
|
||||||
|
|
Loading…
Reference in a new issue