How do you define the flush method when compressing a buffer using Node.js's built-in zlib module? Specifically, I need Z_SYNC_FLUSH. There doesn't seem to be a place in the options to set this flag.
Ah, I figured it out. It's a bit hackish, but you have to modify the flush property. This is kind of equivalent to modifying a public class property in other languages, so it's a bit dirty. I don't know if this will always work, but it got what I wanted.
compressor = zlib.createDeflate();
compressor._flush = zlib.Z_SYNC_FLUSH;