From 6d9a392575295326e03da2e66c16c7fa91a42eaf Mon Sep 17 00:00:00 2001 From: Ben Drucker Date: Wed, 8 Jul 2026 10:24:46 -0700 Subject: [PATCH] Replace through2 with core stream.PassThrough through2 was only used as a no-arg passthrough for .json files. Node's built-in stream.PassThrough does the same thing, so drop the dependency instead of chasing its v5 ESM rewrite. Keeps the package CommonJS and removes a maintenance dependency. --- package.json | 1 - transform.js | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c757943..2626502 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,6 @@ }, "dependencies": { "replace-requires": "^1.1.0", - "through2": "^4.0.1", "transformify": "^0.1.2" }, "standard": { diff --git a/transform.js b/transform.js index 81f2069..9f0d960 100644 --- a/transform.js +++ b/transform.js @@ -1,11 +1,11 @@ 'use strict' -const through = require('through2') +const { PassThrough } = require('stream') const transformify = require('transformify') const replaceRequires = require('replace-requires') module.exports = function (file, options) { - if (/\.json$/.test(file)) return through() + if (/\.json$/.test(file)) return new PassThrough() return transformify(replaceProxyquire)() }