From 49c0a025aad34b9bf41ecef44e5240fe1510c4e8 Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Sat, 21 Dec 2013 10:03:16 +0100 Subject: [PATCH] less clever example --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0777c83..d05644b 100644 --- a/README.md +++ b/README.md @@ -22,11 +22,12 @@ var pack = tar.pack(); // p is a streams2 stream pack.entry({ name: 'my-test.txt' }, 'Hello World!'); // add a file called my-stream-test.txt from a stream -myStream.pipe(pack.entry({ name: 'my-stream-test.txt' }, function(err) { +var entry = pack.entry({ name: 'my-stream-test.txt' }, function(err) { // the stream was added // no more entries pack.finalize(); -})); +}); +myStream.pipe(entry); // pipe the pack stream somewhere pack.pipe(process.stdout);