![]() |
VOOZH | about |
The zlib.brotliCompressSync() method is an inbuilt application programming interface of the Zlib module which is used to compress a chunk of data with BrotliCompress.
Syntax:
zlib.brotliCompressSync( buffer, options )
Parameters: This method accepts two parameters as mentioned above and described below:
Return Value: It returns the chunk of data with BrotliCompress.
The below examples illustrate the use of zlib.brotliCompressSync() method in Node.js:
Example 1:
Output:
// Buffer 8b 04 80 30 31 32 33 34 35 36 37 38 39 03
Example 2:
Output:
8b04803031323334353637383903
Reference: https://nodejs.org/api/zlib.html#zlib_zlib_brotlicompresssync_buffer_options