@@ -278,6 +278,9 @@ Compression strategy.
278
278
<!-- YAML
279
279
added: v0.11.1
280
280
changes:
281
+ - version: REPLACEME
282
+ pr-url: https://github.com/nodejs/node/pull/12001
283
+ description: The `dictionary` option can be an Uint8Array now.
281
284
- version: v5.11.0
282
285
pr-url: https://github.com/nodejs/node/pull/6069
283
286
description: The `finishFlush` option is supported now.
@@ -290,14 +293,15 @@ Each class takes an `options` object. All options are optional.
290
293
Note that some options are only relevant when compressing, and are
291
294
ignored by the decompression classes.
292
295
293
- * ` flush ` (default: ` zlib.constants.Z_NO_FLUSH ` )
294
- * ` finishFlush ` (default: ` zlib.constants.Z_FINISH ` )
295
- * ` chunkSize ` (default: 16* 1024)
296
- * ` windowBits `
297
- * ` level ` (compression only)
298
- * ` memLevel ` (compression only)
299
- * ` strategy ` (compression only)
300
- * ` dictionary ` (deflate/inflate only, empty dictionary by default)
296
+ * ` flush ` {integer} (default: ` zlib.constants.Z_NO_FLUSH ` )
297
+ * ` finishFlush ` {integer} (default: ` zlib.constants.Z_FINISH ` )
298
+ * ` chunkSize ` {integer} (default: 16 × 1024)
299
+ * ` windowBits ` {integer}
300
+ * ` level ` {integer} (compression only)
301
+ * ` memLevel ` {integer} (compression only)
302
+ * ` strategy ` {integer} (compression only)
303
+ * ` dictionary ` {Buffer|Uint8Array} (deflate/inflate only, empty dictionary by
304
+ default)
301
305
302
306
See the description of ` deflateInit2 ` and ` inflateInit2 ` at
303
307
< http://zlib.net/manual.html#Advanced > for more information on these.
@@ -473,89 +477,159 @@ Returns a new [Unzip][] object with an [options][].
473
477
474
478
<!-- type=misc-->
475
479
476
- All of these take a [ Buffer] [ ] or string as the first argument, an optional
477
- second argument to supply options to the ` zlib ` classes and will call the
478
- supplied callback with ` callback(error, result) ` .
480
+ All of these take a [ Buffer] [ ] , [ Uint8Array ] [ ] , or string as the first
481
+ argument, an optional second argument to supply options to the ` zlib ` classes
482
+ and will call the supplied callback with ` callback(error, result) ` .
479
483
480
484
Every method has a ` *Sync ` counterpart, which accept the same arguments, but
481
485
without a callback.
482
486
483
- ### zlib.deflate(buf [ , options] , callback)
487
+ ### zlib.deflate(buffer [ , options] , callback)
484
488
<!-- YAML
485
489
added: v0.6.0
490
+ changes:
491
+ - version: REPLACEME
492
+ pr-url: https://github.com/nodejs/node/pull/12001
493
+ description: The `buffer` parameter can be an Uint8Array now.
486
494
-->
487
- ### zlib.deflateSync(buf [ , options] )
495
+ ### zlib.deflateSync(buffer [ , options] )
488
496
<!-- YAML
489
497
added: v0.11.12
498
+ changes:
499
+ - version: REPLACEME
500
+ pr-url: https://github.com/nodejs/node/pull/12001
501
+ description: The `buffer` parameter can be an Uint8Array now.
490
502
-->
491
503
492
- Compress a [ Buffer] [ ] or string with [ Deflate] [ ] .
504
+ - ` buffer ` {Buffer|Uint8Array|string}
505
+
506
+ Compress a chunk of data with [ Deflate] [ ] .
493
507
494
- ### zlib.deflateRaw(buf [ , options] , callback)
508
+ ### zlib.deflateRaw(buffer [ , options] , callback)
495
509
<!-- YAML
496
510
added: v0.6.0
511
+ changes:
512
+ - version: REPLACEME
513
+ pr-url: https://github.com/nodejs/node/pull/12001
514
+ description: The `buffer` parameter can be an Uint8Array now.
497
515
-->
498
- ### zlib.deflateRawSync(buf [ , options] )
516
+ ### zlib.deflateRawSync(buffer [ , options] )
499
517
<!-- YAML
500
518
added: v0.11.12
519
+ changes:
520
+ - version: REPLACEME
521
+ pr-url: https://github.com/nodejs/node/pull/12001
522
+ description: The `buffer` parameter can be an Uint8Array now.
501
523
-->
502
524
503
- Compress a [ Buffer] [ ] or string with [ DeflateRaw] [ ] .
525
+ - ` buffer ` {Buffer|Uint8Array|string}
526
+
527
+ Compress a chunk of data with [ DeflateRaw] [ ] .
504
528
505
- ### zlib.gunzip(buf [ , options] , callback)
529
+ ### zlib.gunzip(buffer [ , options] , callback)
506
530
<!-- YAML
507
531
added: v0.6.0
532
+ changes:
533
+ - version: REPLACEME
534
+ pr-url: https://github.com/nodejs/node/pull/12001
535
+ description: The `buffer` parameter can be an Uint8Array now.
508
536
-->
509
- ### zlib.gunzipSync(buf [ , options] )
537
+ ### zlib.gunzipSync(buffer [ , options] )
510
538
<!-- YAML
511
539
added: v0.11.12
540
+ changes:
541
+ - version: REPLACEME
542
+ pr-url: https://github.com/nodejs/node/pull/12001
543
+ description: The `buffer` parameter can be an Uint8Array now.
512
544
-->
513
545
514
- Decompress a [ Buffer] [ ] or string with [ Gunzip] [ ] .
546
+ - ` buffer ` {Buffer|Uint8Array|string}
547
+
548
+ Decompress a chunk of data with [ Gunzip] [ ] .
515
549
516
- ### zlib.gzip(buf [ , options] , callback)
550
+ ### zlib.gzip(buffer [ , options] , callback)
517
551
<!-- YAML
518
552
added: v0.6.0
553
+ changes:
554
+ - version: REPLACEME
555
+ pr-url: https://github.com/nodejs/node/pull/12001
556
+ description: The `buffer` parameter can be an Uint8Array now.
519
557
-->
520
- ### zlib.gzipSync(buf [ , options] )
558
+ ### zlib.gzipSync(buffer [ , options] )
521
559
<!-- YAML
522
560
added: v0.11.12
561
+ changes:
562
+ - version: REPLACEME
563
+ pr-url: https://github.com/nodejs/node/pull/12001
564
+ description: The `buffer` parameter can be an Uint8Array now.
523
565
-->
524
566
525
- Compress a [ Buffer] [ ] or string with [ Gzip ] [ ] .
567
+ - ` buffer ` { Buffer|Uint8Array| string}
526
568
527
- ### zlib.inflate(buf[ , options] , callback)
569
+ Compress a chunk of data with [ Gzip] [ ] .
570
+
571
+ ### zlib.inflate(buffer[ , options] , callback)
528
572
<!-- YAML
529
573
added: v0.6.0
574
+ changes:
575
+ - version: REPLACEME
576
+ pr-url: https://github.com/nodejs/node/pull/12001
577
+ description: The `buffer` parameter can be an Uint8Array now.
530
578
-->
531
- ### zlib.inflateSync(buf [ , options] )
579
+ ### zlib.inflateSync(buffer [ , options] )
532
580
<!-- YAML
533
581
added: v0.11.12
582
+ changes:
583
+ - version: REPLACEME
584
+ pr-url: https://github.com/nodejs/node/pull/12001
585
+ description: The `buffer` parameter can be an Uint8Array now.
534
586
-->
535
587
536
- Decompress a [ Buffer] [ ] or string with [ Inflate ] [ ] .
588
+ - ` buffer ` { Buffer|Uint8Array| string}
537
589
538
- ### zlib.inflateRaw(buf[ , options] , callback)
590
+ Decompress a chunk of data with [ Inflate] [ ] .
591
+
592
+ ### zlib.inflateRaw(buffer[ , options] , callback)
539
593
<!-- YAML
540
594
added: v0.6.0
595
+ changes:
596
+ - version: REPLACEME
597
+ pr-url: https://github.com/nodejs/node/pull/12001
598
+ description: The `buffer` parameter can be an Uint8Array now.
541
599
-->
542
- ### zlib.inflateRawSync(buf [ , options] )
600
+ ### zlib.inflateRawSync(buffer [ , options] )
543
601
<!-- YAML
544
602
added: v0.11.12
603
+ changes:
604
+ - version: REPLACEME
605
+ pr-url: https://github.com/nodejs/node/pull/12001
606
+ description: The `buffer` parameter can be an Uint8Array now.
545
607
-->
546
608
547
- Decompress a [ Buffer] [ ] or string with [ InflateRaw] [ ] .
609
+ - ` buffer ` {Buffer|Uint8Array|string}
610
+
611
+ Decompress a chunk of data with [ InflateRaw] [ ] .
548
612
549
- ### zlib.unzip(buf [ , options] , callback)
613
+ ### zlib.unzip(buffer [ , options] , callback)
550
614
<!-- YAML
551
615
added: v0.6.0
616
+ changes:
617
+ - version: REPLACEME
618
+ pr-url: https://github.com/nodejs/node/pull/12001
619
+ description: The `buffer` parameter can be an Uint8Array now.
552
620
-->
553
- ### zlib.unzipSync(buf [ , options] )
621
+ ### zlib.unzipSync(buffer [ , options] )
554
622
<!-- YAML
555
623
added: v0.11.12
624
+ changes:
625
+ - version: REPLACEME
626
+ pr-url: https://github.com/nodejs/node/pull/12001
627
+ description: The `buffer` parameter can be an Uint8Array now.
556
628
-->
557
629
558
- Decompress a [ Buffer] [ ] or string with [ Unzip] [ ] .
630
+ - ` buf ` {Buffer|Uint8Array|string}
631
+
632
+ Decompress a chunk of data with [ Unzip] [ ] .
559
633
560
634
[ `Accept-Encoding` ] : https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3
561
635
[ `Content-Encoding` ] : https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
@@ -571,3 +645,4 @@ Decompress a [Buffer][] or string with [Unzip][].
571
645
[ Unzip ] : #zlib_class_zlib_unzip
572
646
[ `.flush()` ] : #zlib_zlib_flush_kind_callback
573
647
[ Buffer ] : buffer.html
648
+ [ Uint8Array ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array
0 commit comments