VOOZH about

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

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


  • Courses
  • Tutorials
  • Interview Prep

Node.js zlib.close() Method

Last Updated : 28 Apr, 2025
The zlib.close() method is an inbuilt application programming interface of the Zlib module which is used to close the underlying handle. Syntax:
zlib.close( callback )
Parameters: This method accepts single parameter callback which holds the callback function. Below examples illustrate the use of zlib.close() method in Node.js: Example 1: Output:
Closed!
Example 2:
Output:
Program Completed!
Here, piping is not done as close method closes the hidden handle. Reference: https://nodejs.org/api/zlib.html#zlib_zlib_close_callback
Comment

Explore