We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec1fa85 commit 4dfbb5cCopy full SHA for 4dfbb5c
src/sizeUtils.js
@@ -3,3 +3,11 @@ const zlib = require('zlib');
3
export function gzipSize(input) {
4
return zlib.gzipSync(input, {level: 9}).length;
5
}
6
+
7
+export function brotliSize(input) {
8
+ if (typeof zlib.brotliCompressSync !== 'function') {
9
+ throw new Error('Brotli compression requires Node.js v10.16.0 or higher.');
10
+ }
11
12
+ return zlib.brotliCompressSync(input).length;
13
+}
0 commit comments