zlib 常量
【zlib constants】
zlib.h 中定义的所有常量也都在 require('node:zlib').constants 中定义。在正常操作过程中,通常不需要使用这些常量。它们的文档是为了让它们的存在不令人惊讶。该部分几乎直接摘自 zlib 文档。
【All of the constants defined in zlib.h are also defined on
require('node:zlib').constants. In the normal course of operations, it will
not be necessary to use these constants. They are documented so that their
presence is not surprising. This section is taken almost directly from the
zlib documentation.】
以前,这些常量可以直接从 require('node:zlib') 获取,例如 zlib.Z_NO_FLUSH。目前仍然可以直接从模块访问这些常量,但这种做法已被弃用。
【Previously, the constants were available directly from require('node:zlib'),
for instance zlib.Z_NO_FLUSH. Accessing the constants directly from the module
is currently still possible but is deprecated.】
允许的刷新值。
【Allowed flush values.】
zlib.constants.Z_NO_FLUSHzlib.constants.Z_PARTIAL_FLUSHzlib.constants.Z_SYNC_FLUSHzlib.constants.Z_FULL_FLUSHzlib.constants.Z_FINISHzlib.constants.Z_BLOCK
压缩/解压缩函数的返回码。负值表示错误,正值表示特殊但正常的事件。
【Return codes for the compression/decompression functions. Negative values are errors, positive values are used for special but normal events.】
zlib.constants.Z_OKzlib.constants.Z_STREAM_ENDzlib.constants.Z_NEED_DICTzlib.constants.Z_ERRNOzlib.constants.Z_STREAM_ERRORzlib.constants.Z_DATA_ERRORzlib.constants.Z_MEM_ERRORzlib.constants.Z_BUF_ERRORzlib.constants.Z_VERSION_ERROR
压缩级别。
【Compression levels.】
zlib.constants.Z_NO_COMPRESSIONzlib.constants.Z_BEST_SPEEDzlib.constants.Z_BEST_COMPRESSIONzlib.constants.Z_DEFAULT_COMPRESSION
压缩策略。
【Compression strategy.】
zlib.constants.Z_FILTEREDzlib.constants.Z_HUFFMAN_ONLYzlib.constants.Z_RLEzlib.constants.Z_FIXEDzlib.constants.Z_DEFAULT_STRATEGY