File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,14 @@ const fs = require('fs');
2020const inp = fs .createReadStream (' input.txt' );
2121const out = fs .createWriteStream (' input.txt.gz' );
2222
23- inp .pipe (gzip).pipe (out);
23+ inp .pipe (gzip)
24+ .on (' error' , () => {
25+ // handle error
26+ })
27+ .pipe (out)
28+ .on (' error' , () => {
29+ // handle error
30+ });
2431```
2532
2633It is also possible to compress or decompress data in a single step:
@@ -679,6 +686,7 @@ added: v0.5.8
679686* ` options ` {zlib options}
680687
681688Creates and returns a new [ ` Gzip ` ] [ ] object.
689+ See [ example] [ zlib.createGzip example ] .
682690
683691## zlib.createInflate([ options] )
684692<!-- YAML
@@ -1046,3 +1054,4 @@ Decompress a chunk of data with [`Unzip`][].
10461054[ RFC 7932 ] : https://www.rfc-editor.org/rfc/rfc7932.txt
10471055[ pool size ] : cli.html#cli_uv_threadpool_size_size
10481056[ zlib documentation ] : https://zlib.net/manual.html#Constants
1057+ [ zlib.createGzip example ] : #zlib_zlib
You can’t perform that action at this time.
0 commit comments