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:
François Leurent 2016-10-22 22:59:15 +02:00 committed by Mathias Buus
parent 73176274e2
commit 0eedd881d4

View file

@ -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