@prftesp/setup-azure-npmrc
v1.0.4
Published
Update user .npmrc to consume Azure Artifact Feeds
Downloads
24
Keywords
Readme
Introduction
A CLI tool for updating a user .npmrc for use with Azure Artifact Feeds.
Getting Started
It is good to get some background on how to Set up your client's npmrc. By using an .npmrc we can point it at a Azure Artifact Feed and provide configuration to allow package access. This is useful from a local development and when used within a CI environment.
To get started we should start with the following:
- Create a PAT and scope it to Packaging (Read & write). Do not base64 encode the token.
- Grab the Azure Artifact Feed's npm registry URL by navigating to the desired feed and selecting Connect to Feed followed by npm and copying the value after registry=.
Usage
Available options:
- registry - [required] Azure Artifact Feed npm registry URL
- password - [required] Personal Access Token (not base64 encoded)
- email - Email address (not used)
- scope - Project scope for registry (optional)
After installing via npm we can provide the registry URL for the --registry option and PAT for the --password. The --email is an optional field and can be omitted. An optional --scope can be provided to scope the registry and always-auth fields to a specific package grouping.
Without scope
node ./node_modules/@prftesp/setup-azure-npmrc/setup-azure-npmrc.js --registry https://pkgs.dev.azure.com/<yourOrganization>/_packaging/<yourFeed>/npm/registry/ --password <yourPAT> --email <optional>
With scope
node ./node_modules/@prftesp/setup-azure-npmrc/setup-azure-npmrc.js --registry https://pkgs.dev.azure.com/<yourOrganization>/_packaging/<yourFeed>/npm/registry/ --password <yourPAT> --email <optional> --scope @my-packages
DEBUG
If DEBUG environment variable is provided additional logging information will be provided on execution.