-
-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Clear and concise description of the problem
The pickRegistry utility currently requires users to pass in already parsed npm configs:
fast-npm-meta/package/src/helpers.ts
Line 12 in 4436925
| npmConfigs: Record<string, unknown>, |
Integrating the lookup and parse logic, similar to registry-url, would be convenient.
This way, other packages relying on this wouldn't have to implement it themselves. It's offen needed for packages like node-modules-inspector to determine the current npm registry URL for fetching metadata of private packages.
Suggested solution
Refactor pickRegistry to incorporate this feature, making npmConfigs optional or removing it.
fast-npm-meta/package/src/helpers.ts
Lines 10 to 14 in 4436925
| export function pickRegistry( | |
| scope: string | null | undefined, | |
| npmConfigs: Record<string, unknown>, | |
| defaultRegistry = NPM_REGISTRY, | |
| ): string { |
For the lookup & parsing process:
- Use other lightweight utilities (e.g., registry-url: 777B minified (455B gzip) / 2 modules)
- Or implement it ourselves
Alternative
No response
Additional context
I'm willing to submit a PR for this. 🙌🏻
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.