From cc3174a937fcb6f64de357830af1f57afae2e602 Mon Sep 17 00:00:00 2001 From: Alexander O'Mara Date: Wed, 17 May 2017 20:09:00 -0400 Subject: [PATCH] zlib: expose amount of data read for engines Added bytesRead property to Zlib engines Fixes: https://github.com/nodejs/node/issues/8874 PR-URL: https://github.com/nodejs/node/pull/13088 Reviewed-By: Anna Henningsen Reviewed-By: Sam Roberts --- doc/api/zlib.md | 11 ++++ lib/zlib.js | 4 ++ test/parallel/test-zlib-bytes-read.js | 93 +++++++++++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 test/parallel/test-zlib-bytes-read.js diff --git a/doc/api/zlib.md b/doc/api/zlib.md index e97ba9cc83e0cd..f57b3d0599bbbe 100644 --- a/doc/api/zlib.md +++ b/doc/api/zlib.md @@ -386,6 +386,17 @@ added: v0.5.8 Not exported by the `zlib` module. It is documented here because it is the base class of the compressor/decompressor classes. +### zlib.bytesRead + + +* {number} + +The `zlib.bytesRead` property specifies the number of bytes read by the engine +before the bytes are processed (compressed or decompressed, as appropriate for +the derived class). + ### zlib.flush([kind], callback)