File tree 1 file changed +10
-1
lines changed
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');
20
20
const inp = fs .createReadStream (' input.txt' );
21
21
const out = fs .createWriteStream (' input.txt.gz' );
22
22
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
+ });
24
31
```
25
32
26
33
It is also possible to compress or decompress data in a single step:
@@ -679,6 +686,7 @@ added: v0.5.8
679
686
* ` options ` {zlib options}
680
687
681
688
Creates and returns a new [ ` Gzip ` ] [ ] object.
689
+ See [ example] [ zlib.createGzip example ] .
682
690
683
691
## zlib.createInflate([ options] )
684
692
<!-- YAML
@@ -1046,3 +1054,4 @@ Decompress a chunk of data with [`Unzip`][].
1046
1054
[ RFC 7932 ] : https://www.rfc-editor.org/rfc/rfc7932.txt
1047
1055
[ pool size ] : cli.html#cli_uv_threadpool_size_size
1048
1056
[ 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