vsts-npm-auth
Version:
Auth Helper for npm in Azure Artifacts
56 lines (47 loc) • 2.45 kB
Markdown
Integrate npm and Azure Artifacts with this authentication bootstrapper.
```
npm install -g vsts-npm-auth
vsts-npm-auth -config path-to-your\.npmrc
```
```
registry=https://my-azure-artifacts-npm-registry-uri-here
always-auth=true
```
```bash
$ npm install -g vsts-npm-auth --registry https://registry.npmjs.com
$ vsts-npm-auth -config path-to-your\.npmrc
```
The auth helper is currently only functional on a Windows machine. Users on other platforms
will need to get a Personal Access Token from their Azure DevOps Services (formerly Visual Studio Team Services)
account and manually configure their user .npmrc
## Options
```
c:\>.\vsts-npm-auth.exe -?
Usage - vsts-npm-auth -options
GlobalOption Description
Help (-?) Shows this help
NonInteractive (-N) Don't allow interactively prompting for credentials to obtain a token
Config* (-C) Comma-separated list of paths to npm configuration file containing package sources to
acquire authentication tokens for
TargetConfig (-T) npm configuration file to write the generated tokens to. Usually user tokens are written to
%USERPROFILE%/.npmrc, ~/.npmrc or $HOME/.npmrc
ExpirationMinutes (-E) Minutes until acquired tokens should expire. [Default='129600']
ReadOnly (-R) Request a read-only token. If absent or false, a read-write token will be requested. This
parameter is effective only if the target configuration file has no token or a token that
is near or past expiration. To force token acquisition, use the -Force parameter.
[]
Force (-F) Force token acquisition. If absent or false, an existing token in the target configuration
file will only be replaced if it is near or past expiration. [Default='False']
Verbosity (-V) Display this amount of detail in the output: silent, quiet, normal, detailed.
Silent
Quiet
Normal
Detailed
```