Summary
Use this issue as the PR-cut tracker for Node-compatible zlib option objects and stream retuning. Perry exposes most non-Zstd node:zlib codec shapes, but one-shot codecs, stream factories, Brotli params, dictionaries/output limits, and stream.params() do not yet apply Node's option semantics consistently.
Child Issues
Intended PR Boundary
A good medium-sized PR should parse, validate, and apply the common Node zlib options for already implemented codecs:
- one-shot zlib methods:
level, strategy, windowBits, memLevel, dictionary, flush / finishFlush, and maxOutputLength where applicable;
- Brotli one-shot and stream methods:
params, chunkSize, maxOutputLength, info, and dictionary/decompressor options where applicable;
- stream factories: carry parsed options into encoder/decoder state instead of using fixed defaults;
stream.params(level, strategy, callback): validate inputs, retune deflate-family streams, and complete the callback with Node-observable semantics.
Exact compressed bytes do not need to match Node when the backend produces a valid stream, but output must be option-sensitive and validation must match Node for covered cases.
Non-Goals
Evidence
docs/runtime-parity-gaps.md lists node:zlib options-adjacent APIs such as stream factories, one-shot raw/Brotli codecs, params(), bytesWritten, bytesRead, crc32, and constants as gaps.
test-parity/node-suite/zlib already has deterministic round-trip, constants, Brotli, raw, unzip, stream, and crc32 fixtures that can be extended for option-sensitive behavior.
- Source evidence in the child issues points at one-shot codecs using fixed compression defaults, stream factories ignoring
_opts, fixed Brotli quality/window settings, and zlib_stream_params() ignoring handle/level/strategy.
- Duplicate searches for
node:zlib zlib options level strategy windowBits memLevel dictionary Brotli params quality chunkSize and node:zlib stream.params params level strategy callback retune found this tracker and no active PR.
Acceptance
- Child issues above have focused parity/regression coverage.
- One-shot and stream-factory option objects produce Node-compatible validation and option-sensitive output for covered cases.
stream.params() retunes supported deflate-family streams or reports Node-compatible errors for covered cases.
- Existing gzip/deflate/raw/Brotli round-trip fixtures keep passing.
- Related parity docs / known-failure entries are updated if touched.
Summary
Use this issue as the PR-cut tracker for Node-compatible zlib option objects and stream retuning. Perry exposes most non-Zstd
node:zlibcodec shapes, but one-shot codecs, stream factories, Brotli params, dictionaries/output limits, andstream.params()do not yet apply Node's option semantics consistently.Child Issues
node:zlib: honor compression options in one-shot and stream codecsnode:zlib: make stream.params retune compression level and strategyIntended PR Boundary
A good medium-sized PR should parse, validate, and apply the common Node zlib options for already implemented codecs:
level,strategy,windowBits,memLevel,dictionary,flush/finishFlush, andmaxOutputLengthwhere applicable;params,chunkSize,maxOutputLength,info, and dictionary/decompressor options where applicable;stream.params(level, strategy, callback): validate inputs, retune deflate-family streams, and complete the callback with Node-observable semantics.Exact compressed bytes do not need to match Node when the backend produces a valid stream, but output must be option-sensitive and validation must match Node for covered cases.
Non-Goals
zlib.codesmetadata tracked by node:zlib: expose codes error-code table #2688.params().Evidence
docs/runtime-parity-gaps.mdlistsnode:zliboptions-adjacent APIs such as stream factories, one-shot raw/Brotli codecs,params(),bytesWritten,bytesRead,crc32, and constants as gaps.test-parity/node-suite/zlibalready has deterministic round-trip, constants, Brotli, raw, unzip, stream, and crc32 fixtures that can be extended for option-sensitive behavior._opts, fixed Brotli quality/window settings, andzlib_stream_params()ignoring handle/level/strategy.node:zlib zlib options level strategy windowBits memLevel dictionary Brotli params quality chunkSizeandnode:zlib stream.params params level strategy callback retunefound this tracker and no active PR.Acceptance
stream.params()retunes supported deflate-family streams or reports Node-compatible errors for covered cases.