NpmAddUserAliases.

NpmAddUser(ICakeContext, NpmAddUserSettings) Method

Summary

Adds user using the specified settings.
Assembly
Cake.Npm.dll
Namespace
Cake.Npm
Containing Type
NpmAddUserAliases

Syntax

public static void NpmAddUser(this ICakeContext context, NpmAddUserSettings settings)

Examples

Base url of package registry ('npm adduser --registry=http://myregistry.example.com')

var settings = 
        new NpmAddUserSettings 
        {
            Registry = "http://myregistry.example.com"
        };
    NpmAddUser(settings);

Scope assoicated with the user ('npm adduser --scope=@cake')

var settings = 
        new NpmAddUserSettings 
        {
            Scope = "@cake"
        };
    NpmAddUser(settings);

Indicates that all requests to the given registry should include authorization information ('npm adduser --registry=http://private-registry.example.com --always-auth')

var settings = 
        new NpmAddUserSettings 
        {
            AlwaysAuthenticate = true
        };
    NpmAddUser(settings);

What authentication strategy to use ('npm adduser --auth-type=legacy')

var settings = 
        new NpmAddUserSettings 
        {
            AuthType = AuthType.Legacy
        };
    NpmAddUser(settings);

Use specific log level ('npm adduser')

var settings = 
        new NpmAddUserSettings 
        {
            LogLevel = NpmLogLevel.Verbose
        };
    NpmAddUser(settings);

Attributes

Type Description
CakeMethodAliasAttribute
CakeAliasCategoryAttribute

Parameters

Name Type Description
context ICakeContext The context.
settings NpmAddUserSettings The settings.

Return Value

Type Description
void