deno
2dde118d - fix(ext/node): add module findPackageJSON export (#34597)

Commit
60 days ago
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>
Author
Parents
Loading