
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
registry-url
Advanced tools
Get the set npm registry URL
It's usually https://registry.npmjs.org/, but it's configurable.
Use this if you do anything with the npm registry as users will expect it to use their configured registry.
npm install registry-url
# .npmrc
registry = 'https://custom-registry.com/'
import registryUrl, {defaultUrl} from 'registry-url';
console.log(registryUrl());
//=> 'https://custom-registry.com/'
console.log(defaultUrl);
//=> 'https://registry.npmjs.org/'
It can also retrieve the registry URL associated with an npm scope.
# .npmrc
@myco:registry = 'https://custom-registry.com/'
import registryUrl from 'registry-url';
console.log(registryUrl('@myco'));
//=> 'https://custom-registry.com/'
If the provided scope is not in the user's .npmrc file, then registry-url will check for the existence of registry, or if that's not set, fallback to the default npm registry.
The npm-conf package is used to get the configuration values that npm would use. It is more general than registry-url as it can retrieve all configuration options, not just the registry URL. However, it is more complex to use if you only need the registry URL.
Config-chain is a utility for pulling nested configuration data from INI and JSON files, environment variables, and command-line arguments. It is more versatile than registry-url, offering a broader range of configuration options, but it is also more complex and not specific to npm settings.
FAQs
Get the set npm registry URL
The npm package registry-url receives a total of 18,026,109 weekly downloads. As such, registry-url popularity was classified as popular.
We found that registry-url demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.