through2 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [5.0.1](https://github.com/rvagg/through2/compare/v5.0.0...v5.0.1) (2026-05-15)
2
+
3
+ ### Bug Fixes
4
+
5
+ * add CJS support for Node.js 22.12+ ([#120](https://github.com/rvagg/through2/issues/120)) ([eef0aa0](https://github.com/rvagg/through2/commit/eef0aa044844c09b69ede525873c72579ea0c86a))
6
+
1
7
  ## [5.0.0](https://github.com/rvagg/through2/compare/v4.0.2...v5.0.0) (2026-05-07)
2
8
 
3
9
  ### ⚠ BREAKING CHANGES
package/README.md CHANGED
@@ -77,7 +77,7 @@ await response.body
77
77
 
78
78
  v5 is a major version bump. Headline changes:
79
79
 
80
- - **ESM only.** `require('through2')` no longer works. Convert callers to `import` or pin to `through2@4`.
80
+ - **ESM source.** The package ships as ESM; new code should `import` it. CommonJS callers can still `require('through2')` on Node.js 22.12+ via `require(esm)`. On older Node, convert to `import` or pin to `through2@4`.
81
81
  - **Named exports added.** `transform`, `objectTransform`, `transformer` are the preferred surface in new code.
82
82
  - **Default export still works.** `through2(fn)`, `through2.obj(fn)`, and `through2.ctor(fn)` produce equivalent stream instances. Once your callers are converted to ESM imports, the call-site syntax and runtime behaviour are unchanged (modulo the `instanceof` caveat below).
83
83
  - **Async functions and async generators are now accepted** as transform functions, in addition to the classic `(chunk, enc, cb)` callback form. See [Transform function styles](#transform-function-styles).
package/package.json CHANGED
@@ -1,18 +1,20 @@
1
1
  {
2
2
  "name": "through2",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "Tiny utilities for inserting transformation logic into Node.js stream and Web Streams pipelines",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "main": "./through2.js",
8
8
  "exports": {
9
9
  ".": {
10
+ "types": "./types/through2.d.ts",
10
11
  "import": "./through2.js",
11
- "types": "./types/through2.d.ts"
12
+ "require": "./through2.js"
12
13
  },
13
14
  "./web": {
15
+ "types": "./types/web.d.ts",
14
16
  "import": "./web.js",
15
- "types": "./types/web.d.ts"
17
+ "require": "./web.js"
16
18
  }
17
19
  },
18
20
  "types": "./types/through2.d.ts",