Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

Commit

Permalink
Some improvement in 3_compress_a_stream
Browse files Browse the repository at this point in the history
  • Loading branch information
me-shaon committed Jul 25, 2017
1 parent f6cecf2 commit 9ea3672
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions 3_compress_a_stream/README.md
@@ -1,7 +1,7 @@
# Compress a stream of data in NodeJS

A cool thing about Streams is that you can chain them using pipes. This means that you can manipulate the data that is coming in real time. This example shows perfectly how you can compress the content of a file by piping the stream to the zlib lib module before saving it back to disk or passing it to the next pipe.
A cool thing about Streams is that you can chain them using pipes. This means that you can manipulate the data that is coming in real time. This example shows perfectly how you can compress the content of a file by piping the stream to the **zlib** lib module before saving it back to disk or passing it to the next pipe.

# How to Run the Code

Simply type the following command in the terminal `node index.js`.
Simply type the following command in the terminal `node index.js`.
4 changes: 2 additions & 2 deletions 3_compress_a_stream/index.js
Expand Up @@ -24,7 +24,7 @@ let options_compressed = {
}

//
// Open a file to be red
// Open a file to be read
//
let raw_file = fs.createReadStream('./file.txt', options_raw);

Expand All @@ -43,4 +43,4 @@ let gz = zlib.createGzip();
//
raw_file
.pipe(gz)
.pipe(to_compressed_file);
.pipe(to_compressed_file);

0 comments on commit 9ea3672

Please sign in to comment.