VOOZH about

URL: https://www.geeksforgeeks.org/node-js/node-js-zlib-deflateraw-method/

⇱ Node.js zlib.deflateRaw() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Node.js zlib.deflateRaw() Method

Last Updated : 12 Oct, 2021
The zlib.deflateRaw() method is an inbuilt application programming interface of the Zlib module which is used to compress a chunk of data. Syntax:
zlib.deflateRaw( buffer, options, callback )
Parameters: This method accepts three parameters as mentioned above and described below:
  • buffer: It can be of type Buffer, TypedArray, DataView, ArrayBuffer, and string.
  • options: It is an optional parameter that holds the zlib options.
  • callback: It holds the callback function.
Return Value: It returns the chunk of data after compression. Below examples illustrate the use of zlib.deflateRaw() method in Node.js: Example 1: Output:
f3cb4cc9c85408cecc4bcf0000
Example 2: Output:
734f4dcd2e4ecb2f7207d100
Reference: https://nodejs.org/api/zlib.html#zlib_zlib_deflateraw_buffer_options_callback
Comment

Explore