GitShow/sindresorhus/registry-url
sindresorhus

registry-url

Get the set npm registry URL

by sindresorhus
Star on GitHubForknpm

JavaScript

57 stars19 forks13 contributorsQuiet · 1y agoSince 2014v7.2.0MIT

Meet the team

See all 13 on GitHub →
sindresorhus
sindresorhus39 contributions
zanminkian
zanminkian5 contributions
BendingBender
BendingBender2 contributions
SamVerschueren
SamVerschueren2 contributions
coreyfarrell
coreyfarrell1 contribution
ENT8R
ENT8R1 contribution
eush77
eush771 contribution
hutson
hutson1 contribution

Languages

View on GitHub →
JavaScript95.8%
TypeScript4.2%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent fixes

View closed PRs →
zarenner
Adding trailing slash causes libraries like registry-auth-token to fail finding settingsClosedIssue

Because registry-url adds trailing slashes to registry URLs, update-notifier (and anything else using registry-auth-token) doesn't currently work with some registry/auth URLs. Specifically, if the registry URL doesn't contain a trailing slash, like: @myscope:registry=https://contoso.pkgs.visualstudio.com/_packaging/MyFeed/npm/registry npm itself requires the following authToken line, due to its nerf-darting: //contoso.pkgs.visualstudio.com/_packaging/MyFeed/npm/:_authToken= But because registry-url appends a trailing slash, it makes the following registry url: @myscope:registry=https://contoso.pkgs.visualstudio.com/_packaging/MyFeed/npm/registry/ which (when using a library like registry-auth-token / matching npm's behavior) doesn't work with: //contoso.pkgs.visualstudio.com/_packaging/MyFeed/npm/:_authToken= and instead requires //contoso.pkgs.visualstudio.com/_packaging/MyFeed/npm/registry/:_authToken= Note that registry-auth-token had buggy behavior as well, and in 3.1.1 just took the fix https://github.com/rexxars/registry-auth-token/issues/10 to match npm's behavior. Was there a reason for adding the additional trailing slash? There must have been since I see tests for it, but it seems wrong to do and is causing this failure. Thanks.

zarenner · 6mo ago
colbywhite
does not necessarilly honor global npmrcClosedIssue

due to the way this uses , this pkg will find a url specified in a user's file, but not necessarily the _global_ npmrc. the _global_ npmrc according to npm is located at where is determined based on where node is installed. for example, the docker container comes with a node install where the global config is expected to be at . if you're using , your npm will look for a file somewhere similar to . looking at how defines its logic, it will never look at , looking at instead. and thus if the registry url is defined in a global npmrc, this pkg will never find it.

colbywhite · 9mo ago
RayBenefield
Awareness of `.yarnrc`ClosedIssue

Stumbled upon this possibly being needed by someone in the future while debugging: https://github.com/yarnpkg/yarn/issues/2935 can also be set in and if someone is using the workaround for the above and store it in instead of then this package may not pick that up. I haven't tested it yet though, just thought it might be helpful to have this issue here.

RayBenefield · 11mo ago
Structured data for AI agents

Repository: sindresorhus/registry-url. Description: Get the set npm registry URL Stars: 57, Forks: 19. Primary language: JavaScript. Languages: JavaScript (95.8%), TypeScript (4.2%). License: MIT. Latest release: v7.2.0 (1y ago). Open PRs: 0, open issues: 0. Last activity: 1y ago. Community health: 85%. Top contributors: sindresorhus, zanminkian, BendingBender, SamVerschueren, coreyfarrell, ENT8R, eush77, hutson, jasonk, kevva and others.

·@ofershap

Replace github.com with gitshow.dev