Socket
Socket
Sign inDemoInstall

registry-url

Package Overview
Dependencies
5
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Protect your apps from supply chain attacks

Install

registry-url

Get the set npm registry URL

    6.0.1latest
    GitHub
    npm

Version published
Maintainers
1
Weekly downloads
9,146,278
increased by4.11%

Weekly downloads

Package description

What is registry-url?

The registry-url npm package is used to get the set npm registry URL. It is particularly useful when working with npm configurations that may have different registry URLs set for different scopes or projects. This package simplifies the process of retrieving the registry URL that npm will use in the current context.

What are registry-url's main functionalities?

Get the default registry URL

This feature allows you to retrieve the default npm registry URL that is configured on your system.

const registryUrl = require('registry-url');
console.log(registryUrl()); // Outputs the default registry URL

Get the registry URL for a specific scope

This feature allows you to retrieve the npm registry URL for a specific scope, which can be different from the default registry URL.

const registryUrl = require('registry-url');
console.log(registryUrl('@my-scope')); // Outputs the registry URL for the '@my-scope' if configured, otherwise the default.

Other packages similar to registry-url

Readme

Source

registry-url

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.

Install

$ npm install registry-url

Usage

# .npmrc
registry = 'https://custom-registry.com/'
import registryUrl from 'registry-url';

console.log(registryUrl());
//=> 'https://custom-registry.com/'

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.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

Last updated on 22 Jun 2022

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc