Skip to content
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

Allow overriding the registry URL #31

Closed
itaisteinherz opened this issue Feb 26, 2019 · 5 comments · Fixed by #33
Closed

Allow overriding the registry URL #31

itaisteinherz opened this issue Feb 26, 2019 · 5 comments · Fixed by #33

Comments

@itaisteinherz
Copy link
Contributor

itaisteinherz commented Feb 26, 2019

In some cases (e.g. in np - see sindresorhus/np#350 and sindresorhus/np#317) you want to resolve a package name for a given registry that wasn't configured to be the user's default registry. I think that npm-name should still use the registry URL returned by registry-url as the default one, but also accept an optional registry URL as the second argument, i.e. npmName(name, [registryUrl]) and npmName.many(names, [registryUrl]).

// cc @weekens @jdziat

@sindresorhus
Copy link
Owner

Not a big fan of this idea. I would prefer it to be fully automatic or if that's not possible, for np just to skip the name checking.

@sindresorhus
Copy link
Owner

sindresorhus commented Feb 27, 2019

Also note that npm-name supports private registries now: c4e850b

@itaisteinherz
Copy link
Contributor Author

Also note that npm-name supports private registries now

It does, but it won't be able to correctly check the name of a private package in case the package is a private package which is published to a custom private registry, while the currently configured npm registry is a different one (probably https://registry.npmjs.org in the issues I've mentioned above).

@sindresorhus
Copy link
Owner

Since I accepted sindresorhus/package-json@53c40f2, I guess I should accept this too, but it too should come with a big warning about when and when not to use it.

@itaisteinherz
Copy link
Contributor Author

I'll work on a PR to add this 👌🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants