SIGN IN SIGN UP
denoland / deno UNCLAIMED

A modern runtime for JavaScript and TypeScript.

0 0 22 Rust

fix(ext/node): add module findPackageJSON export (#34597)

Adds the `findPackageJSON` export to `node:module` and wires it onto the
`Module` default export. The implementation resolves bare package
specifiers to the package root and file/relative specifiers to the
closest package.json, matching Node's documented behavior for package
subpaths and resolved file URLs.\n\nTests:\n- `cargo build --bin deno
--bin test_server`\n- `cargo test -p unit_node_tests --test unit_node --
module_test`\n- `cargo check -p deno_node`\n- `deno fmt --check
ext/node/polyfills/01_require.js tests/unit_node/module_test.ts`\n-
direct `target/debug/deno run --node-modules-dir=manual` repro for
`findPackageJSON(import.meta.resolve(...))`\n\n

Closes denoland/orchid#347

Co-authored-by: divybot <divybot@users.noreply.github.com>
Co-authored-by: Divy Srivastava <me@littledivy.com>
E
em committed
2dde118d569bb508eba62cae5c8013d775530bfa
Parent: 3e56bfd
Committed by GitHub <noreply@github.com> on 5/31/2026, 5:08:31 AM