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
registryStepRegistryloggerIBuildLoggerexecutorFactoryFunc<ICommandExecutor>nodeEnsurerNodeSdkEnsurer
Methods
Build(DirectoryRef)
Runs 'npm run build'.
public void Build(DirectoryRef directory)
Parameters
directoryDirectoryRefDirectory containing package.json.
Ci(DirectoryRef)
Runs 'npm ci' for clean install (preferred for CI).
public void Ci(DirectoryRef directory)
Parameters
directoryDirectoryRefDirectory containing package.json.
Install(DirectoryRef)
Runs 'npm install' to install dependencies.
public void Install(DirectoryRef directory)
Parameters
directoryDirectoryRefDirectory containing package.json.
Run(DirectoryRef, string)
Runs an npm script defined in package.json.
public void Run(DirectoryRef directory, string scriptName)
Parameters
directoryDirectoryRefDirectory containing package.json.
scriptNamestringName of the script to run.
Test(DirectoryRef)
Runs 'npm test'.
public void Test(DirectoryRef directory)
Parameters
directoryDirectoryRefDirectory containing package.json.