1.0.0 • Published 2 years ago

npmregistryconsumerpoc v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Accessing a private npm registry

To access a private npm registry add an .npmrc config file to your repo.

In the set up guide for the npm registry, I mentioned that having a SCOPE was incredibly important for you package name. This is because in your .npmrc, you will specify which registry to use for that specific scope:

@SCOPE:registry=https://npm.pkg.github.com/SCOPE

Typically this will be your org name or your user name.

If this registry is private, you will need to be authorized to read from this repo.

To do this you add

//npm.pkg.github.com/:_authToken=AUTH_TOKEN

to your .npmrc, where AUTH_TOKEN is a token generated from github.

As I mentioned in the guide for creating an npm registry through github, doing this means the .npmrc should be encrypted or otherwise not included in the repo (e.g. added to the .gitignore)