Nnodejs

nodejs/zlib-bytesread-to-byteswritten

Handle DEP0108 by replacing deprecated `zlib.bytesRead` with `zlib.bytesWritten` in Node.js transform streams

transformationmigrationzlibbytesReadbytesWritten
Public
140 executions
Run locally
npx codemod @nodejs/zlib-bytesread-to-byteswritten
Documentation

zlib.bytesReadzlib.bytesWritten DEP0108

This codemod replaces zlib.bytesRead with zlib.bytesWritten for consistent stream property naming. It's useful to migrate code that uses the deprecated property which has been removed.

It replaces zlib.bytesRead with zlib.bytesWritten in all zlib transform streams and it handles both CommonJS and ESM imports.

See DEP0108.


Example

Case 1

Before:

js

After:

js

Case 2

Before:

js

After:

js

Case 3

Before:

js

After:

js

Case 4

Before:

js

After:

js

Case 5

Before:

js

After:

js

Case 6

Before:

js

After:

js

Ready to contribute?

Build your own codemod and share it with the community.