NpmInstallSettings Class

Summary

Contains settings used by NpmInstaller.
Namespace
Cake.Npm.Install
Base Types
graph BT Type-->Base0["NpmSettings"] click Base0 "/Cake.Npm/api/Cake.Npm/NpmSettings" Base0-->Base1["object"] Type["NpmInstallSettings"] class Type type-node

Syntax

public class NpmInstallSettings : NpmSettings

Constructors

Name Summary
NpmInstallSettings() Initializes a new instance of the NpmInstallSettings class.

Properties

Name Value Summary
Force bool
Gets a value indicating whether npm should fetch remote resources even if a local copy exists on disk.
Global bool
Gets a value indicating whether the package should be installed globally rather than locally.
NoOptional bool
Gets a value indicating whether npm should prevent optional dependencies from being installed (the --no-optional argument)
Packages IList<string>
Gets the list of packages which should be installed.
PreferOffline bool
Gets or sets a value indicating whether or not to utilise the prefer offline flag, avoiding going to the internet for packages if possible.
Production bool
Gets a value indicating whether npm should ignore modules listed in
devDependencies
.
Registry Uri
Gets or sets a value indicating which registry we should point to. Defaulted to whatever the NPM configuration is.

Methods

Name Value Summary
EvaluateCore(ProcessArgumentBuilder) void
Evaluates the settings and writes them to args.

Extension Methods

Name Value Summary
AddPackage(string) NpmInstallSettings
Install a package by name, version/tag.
AddPackage(string, string) NpmInstallSettings
Install a package by name and version/tag.
AddPackage(string, string, string) NpmInstallSettings
Install a package by name, version/tag and scope.
AddPackage(Uri) NpmInstallSettings
Install a package from a specific url.
AddScopedPackage(string, string) NpmInstallSettings
Install a scoped package by name, version/tag.
ForProduction() NpmInstallSettings
Defines that npm should ignore modules listed in devDependencies.
FromPath(DirectoryPath) NpmSettings
Sets the working directory which should be used to run the npm command.
FromRegistry(Uri) NpmInstallSettings
Instructs npm to look for packages in the given registry.
InstallGlobally() NpmInstallSettings
Defines that the package should be installed globally.
InstallLocally() NpmInstallSettings
Defines that the package should be installed locally.
SetRedirectedStandardErrorHandler(Action<string>) NpmSettings
Sets the StandardError-Action
SetRedirectedStandardOutputHandler(Action<string>) NpmSettings
Sets the StandardOutput-Action
WithForce() NpmInstallSettings
Defines that npm should fetch remote resources even if a local copy exists on disk.
WithForce(bool) NpmInstallSettings
Defines whether npm should fetch remote resources even if a local copy exists on disk.
WithLogLevel(NpmLogLevel) NpmSettings
Sets the log level which should be used to run the npm command.
WithNoOptional(bool) NpmInstallSettings
Defines whether npm should prevent optional dependencies from being installed
WithOptionalDependencies() NpmInstallSettings
Defines that npm should install optional dependencies
WithoutForce() NpmInstallSettings
Defines that npm should not fetch remote resources if a local copy exists on disk.
WithoutOptionalDependencies() NpmInstallSettings
Defines that npm should prevent optional dependencies from being installed
GitHub
Discussion