best-vsts-npm-auth
v1.0.5
Published
The best VSTS NPM Auth tool
Readme
Best VSTS NPM Auth
Refresh Azure DevOps Artifacts (ADO) and GitHub Packages npm authentication on your machine.
- Reads your project
.npmrc(and any scoped registries). - Gets an access token via Azure CLI (no app registration required).
- Writes short-lived tokens to your user
~/.npmrc(and optionally project.yarnrc.yml).
Prerequisites
- Node.js + npm
- Azure CLI installed and logged in:
az loginInstall
Option A: Install from npm (recommended)
npm i -g best-vsts-npm-authOption B: Install from a GitHub release tarball
- Download
best-vsts-npm-auth-<version>.tgzfrom your Releases page. - Install it globally:
npm i -g /path/to/best-vsts-npm-auth-<version>.tgzRun
Process the local project .npmrc:
best-vsts-npm-auth .Process a specific .npmrc:
best-vsts-npm-auth -n /path/to/.npmrcAlso update Yarn Berry config:
best-vsts-npm-auth -y ./.yarnrc.yml .Notes
- Access tokens are typically valid for ~1 hour. Re-run the tool if you see
401. - Tokens are written only to the user
~/.npmrc(not your project.npmrc) unless you intentionally configure otherwise. - GitHub Packages scoped registries (e.g.
@your-org) are authenticated using the same token.
