[node] add zlib.bytesWritten

This commit is contained in:
Gerhard Stoebich 2019-01-15 10:02:49 +01:00
parent 19817ba6bd
commit 308ec150ad
2 changed files with 7 additions and 0 deletions

View File

@ -1781,7 +1781,9 @@ declare module "zlib" {
}
interface Zlib {
/** @deprecated Use bytesWritten instead. */
readonly bytesRead: number;
readonly bytesWritten: number;
close(callback?: () => void): void;
flush(kind?: number | (() => void), callback?: () => void): void;
}

View File

@ -4172,6 +4172,11 @@ import * as constants from 'constants';
const deflate = zlib.deflateSync('test');
const inflate = zlib.inflateSync(deflate.toString());
}
{
const gzip = zlib.createGzip();
const written: number = gzip.bytesWritten;
}
}
///////////////////////////////////////////////////////////