Skip to content

fix: replace through2 with native stream.Transform - #70

Merged
nmccready merged 1 commit into
masterfrom
fix/drop-through2-use-native-transform
May 15, 2026
Merged

fix: replace through2 with native stream.Transform#70
nmccready merged 1 commit into
masterfrom
fix/drop-through2-use-native-transform

Conversation

@nmccready

Copy link
Copy Markdown
Contributor

Summary

  • through2 v5 went ESM-only (#118) with no CJS compat layer — require('through2') no longer resolves, breaking lint and tests
  • Every usage in this repo was through2.obj(transform, flush), which is exactly new Transform({ objectMode: true, transform, flush }) from Node's built-in stream
  • Drops through2 from dependencies entirely; no new deps, no behaviour change
  • Also fixes a pre-existing typo in src/client.js (though2Transform)

Closes / supersedes dependabot PR #69.

Files changed

File Change
src/server.js require('through2')require('stream').Transform, through2.obj()new Transform(...)
src/client.js same; also fixed though2 typo
tests/utils/logStream.js same
tests/index.nonRx.spec.js same (2 call sites)
examples/helloworld/impls/server.js same
package.json removed through2 from dependencies

Test plan

  • npm run lint — clean
  • npm test — 5/5 files, 41/41 tests pass (2 pre-existing skips)

🤖 Generated with Claude Code

through2 v5 is ESM-only with no CJS compat layer; require('through2')
no longer works. Since every usage was through2.obj(transform, flush),
which is exactly new Transform({ objectMode: true, transform, flush }),
drop the dependency entirely in favor of Node's built-in stream module.

Also fixes the pre-existing typo in client.js (though2 → Transform).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nmccready
nmccready merged commit d9e4de1 into master May 15, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants