# registry-url

> Get the set npm registry URL

Latest version **7.2.0** (published 2025-04-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install registry-url
pnpm add registry-url
yarn add registry-url
bun add registry-url
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 7.2.0 |
| Published | 2025-04-15 |
| First published | 2014-06-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 2 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 57 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | npm, conf, config, npmconf, registry, url, uri, scope |

## Links

- npm: https://www.npmjs.com/package/registry-url
- Repository: https://github.com/sindresorhus/registry-url
- Homepage: https://github.com/sindresorhus/registry-url#readme
- Issues: https://github.com/sindresorhus/registry-url/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/registry-url

## Dependencies (2)

- [ini](https://npm.io/package/ini.md) ^5.0.0
- [find-up-simple](https://npm.io/package/find-up-simple.md) ^1.0.1

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 7.2.0 (latest) — 2025-04-15
- 7.1.0 — 2025-04-10
- 7.0.0 — 2025-04-03
- 6.0.1 — 2022-06-22
- 6.0.0 — 2021-04-17
- 5.1.0 — 2019-04-04
- 5.0.0 — 2019-03-11
- 4.0.0 — 2018-05-27
- 3.1.0 — 2016-04-04
- 3.0.3 — 2015-04-07
- 3.0.2 — 2015-03-31
- 3.0.1 — 2015-03-30
- 3.0.0 — 2015-02-23
- 2.1.0 — 2015-01-18
- 2.0.0 — 2014-10-10
- … 3 more at https://npm.io/package/registry-url/versions

## README

# registry-url

> Get the set npm registry URL

It's usually `https://registry.npmjs.org/`, but it's [configurable](https://docs.npmjs.com/misc/registry).

Use this if you do anything with the npm registry as users will expect it to use their configured registry.

## Install

```sh
npm install registry-url
```

## Usage

```ini
# .npmrc
registry = 'https://custom-registry.com/'
```

```js
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](https://docs.npmjs.com/misc/scope).

```ini
# .npmrc
@myco:registry = 'https://custom-registry.com/'
```

```js
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.

---
_Source: https://npm.io/package/registry-url · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
