import-in-the-middle 1.14.3 → 1.14.4

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.
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "1.14.3"
2
+ ".": "1.14.4"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.14.4](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.14.3...import-in-the-middle-v1.14.4) (2025-09-25)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * Revert "use `createRequire` to load `hook.js` ([#205](https://github.com/nodejs/import-in-the-middle/issues/205))" ([#208](https://github.com/nodejs/import-in-the-middle/issues/208)) ([f23b7ef](https://github.com/nodejs/import-in-the-middle/commit/f23b7ef9e8d4103f21865ec7a1e5374f41d38ff5))
9
+
3
10
  ## [1.14.3](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.14.2...import-in-the-middle-v1.14.3) (2025-09-24)
4
11
 
5
12
 
package/hook.mjs CHANGED
@@ -2,9 +2,7 @@
2
2
  //
3
3
  // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
4
4
 
5
- import { createRequire } from 'node:module'
6
- const require = createRequire(import.meta.url)
7
- const { createHook } = require('./hook.js')
5
+ import { createHook } from './hook.js'
8
6
 
9
7
  const { initialize, load, resolve, getFormat, getSource } = createHook(import.meta)
10
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "import-in-the-middle",
3
- "version": "1.14.3",
3
+ "version": "1.14.4",
4
4
  "description": "Intercept imports in Node.js",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,9 +0,0 @@
1
- import { readFile } from 'fs/promises'
2
-
3
- export async function load (url, context, nextLoad) {
4
- const result = await nextLoad(url, context)
5
- if (!result.source && url.startsWith('file:')) {
6
- result.source = await readFile(new URL(url))
7
- }
8
- return result
9
- }
@@ -1,15 +0,0 @@
1
- // Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License.
2
- //
3
- // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
4
-
5
- import { execSync } from 'child_process'
6
- import { doesNotThrow } from 'assert'
7
-
8
- const env = {
9
- ...process.env,
10
- NODE_OPTIONS: '--no-warnings --experimental-loader ./test/fixtures/double-loader.mjs --experimental-loader ./hook.mjs'
11
- }
12
-
13
- doesNotThrow(() => {
14
- execSync('node -p 0', { env })
15
- })