How to use Node.js zlib module with options?
问题 I need to compress a buffer in Node.js with zlib at the extreme compression level. The outputted header should be 78 DA. Unless I'm missing something, the Node.js documentation doesn't really describe how to use the zlib.Deflate class. It doesn't accept any parameters. http://nodejs.org/api/zlib.html#zlib_class_zlib_deflate 回答1: Use zlib. createGzip / createDeflate to get an instance of the compressor you need, with options in an object. If you want to do this all in-memory: var zlib =