Table of Contents

Class NpmOperations

Namespace
Ando.Operations
Assembly
ando.dll

npm CLI operations for Node.js projects. All methods take a DirectoryRef parameter to specify the working directory.

public class NpmOperations : OperationsBase
Inheritance
NpmOperations
Inherited Members

Constructors

NpmOperations(StepRegistry, IBuildLogger, Func<ICommandExecutor>, NodeSdkEnsurer?)

npm CLI operations for Node.js projects. All methods take a DirectoryRef parameter to specify the working directory.

public NpmOperations(StepRegistry registry, IBuildLogger logger, Func<ICommandExecutor> executorFactory, NodeSdkEnsurer? nodeEnsurer = null)

Parameters

registry StepRegistry
logger IBuildLogger
executorFactory Func<ICommandExecutor>
nodeEnsurer NodeSdkEnsurer

Methods

Build(DirectoryRef)

Runs 'npm run build'.

public void Build(DirectoryRef directory)

Parameters

directory DirectoryRef

Directory containing package.json.

Ci(DirectoryRef)

Runs 'npm ci' for clean install (preferred for CI).

public void Ci(DirectoryRef directory)

Parameters

directory DirectoryRef

Directory containing package.json.

Install(DirectoryRef)

Runs 'npm install' to install dependencies.

public void Install(DirectoryRef directory)

Parameters

directory DirectoryRef

Directory containing package.json.

Run(DirectoryRef, string)

Runs an npm script defined in package.json.

public void Run(DirectoryRef directory, string scriptName)

Parameters

directory DirectoryRef

Directory containing package.json.

scriptName string

Name of the script to run.

Test(DirectoryRef)

Runs 'npm test'.

public void Test(DirectoryRef directory)

Parameters

directory DirectoryRef

Directory containing package.json.