-
-
Notifications
You must be signed in to change notification settings - Fork 34k
module: add findPackageJSON util
#55412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module: add findPackageJSON util
#55412
Conversation
|
Review requested:
|
|
so is this basically just https://www.npmjs.com/package/find-pkg / https://www.npmjs.com/package/pkg-up / https://www.npmjs.com/package/package-up ? |
|
"Just" seems a little dismissive 😕 The first package was last updated 7 years ago (so it may well be outdated, plus its cited limitations). The second package is deprecated. The third is maybe similar/close; it appears to only do direct path manipulation and won't respect module resolution (ex from a loader hook), which this does respect. Edit: looking closer, the third package has several limitations that this does not, such how it handles relative search (cwd vs current module location) and, AFAICS, it does not handle node_modules. This package is also leveraging/mirroring node's internals, so it will behave exactly as node is doing internally (whereas userland may not, and would have to re-invent the wheel to do so). |
|
apologies, you're right, a better way to phrase it is "is this the same capability as these packages". Certainly doing this internally in node is better for tons of reasons, and I'm glad you're adding it :-) I wanted to confirm what the semantics were, is all. |
Ah, yes then 🙂 |
|
The markdown linter is complaining about a codeblock that has no language. It's a directory listing—language is not applicable (it just needs the default codeblock treatment). Can I disable the rule for that block? |
|
can you tag it as |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #55412 +/- ##
==========================================
- Coverage 88.42% 88.41% -0.01%
==========================================
Files 654 654
Lines 187552 187657 +105
Branches 36087 36117 +30
==========================================
+ Hits 165839 165919 +80
- Misses 14950 14972 +22
- Partials 6763 6766 +3
|
That could hack around it, but it would enable shell syntax highlighting. There should be no syntax highlighting. |
|
What about |
Huzzah! perfect. I didn't know that was an option. Thanks! |
mcollina
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
#55229 was too controversial, so back to the original idea from #55173.
Closes #55229