Setting a registry as your default registry

How to use one of your registries as your default npm registry
This information applies for npm. See Maven for information on how to configure your settings.xml file. And NuGet for information on how to configure your NuGet.Config file.

With Bytesafe you are able to control the flow of packages in and out of your organization. By setting your Bytesafe registry as you default registry, you no longer will need to add the --registry argument when you’re installing or publishing packages.

To configure clients to use a specific default registry, you simply need to run this command in the terminal, where WORKSPACE and REGISTRY is replaced with names from your own Bytesafe workspace.

# set a registry as default registry

$ npm config set registry https://{WORKSPACE}.bytesafe.dev/r/{REGISTRY}/

This will set the registry param in a users .npmrc file.

# example .npmrc registry configuration

registry=https://{WORKSPACE}.bytesafe.dev/r/{REGISTRY}/

With a default registry set, users can run npm commands without using the --registry flag:

# npm install without using the `--registry` flag

$ npm install {PACKAGE}

# If you have not configured your registry as the default registry, you will need to be explicit

$ npm --registry https://{WORKSPACE}.bytesafe.dev/r/{REGISTRY}/ install

This may be beneficial for users in organizations that want to make sure that all packages are passed through a specific Bytesafe registry and so that configured Plugins and Policies are used.

For more information on how to setup per project registries and use project level .npmrc files, see using per project registries page.