# Npm Operations Run npm commands for JavaScript/TypeScript projects. ## Operations ### Npm.Install Run 'npm install' to install dependencies. Automatically installs Node.js if not present. ```csharp var frontend = Directory("./frontend"); Npm.Install(frontend); ``` ### Npm.Ci Run 'npm ci' for clean, reproducible installs (preferred for CI). Automatically installs Node.js if not present. ```csharp var frontend = Directory("./frontend"); Npm.Ci(frontend); ``` ### Npm.Run Run an npm script from package.json. Automatically installs Node.js if not present. ```csharp var frontend = Directory("./frontend"); Npm.Run(frontend, "build"); Npm.Run(frontend, "lint"); ``` ### Npm.Test Run 'npm test'. Automatically installs Node.js if not present. ```csharp var frontend = Directory("./frontend"); Npm.Test(frontend); ``` ### Npm.Build Run 'npm run build'. Automatically installs Node.js if not present. ```csharp var frontend = Directory("./frontend"); Npm.Build(frontend); ``` ## Example Build a frontend application. ```csharp // Create a directory reference var frontend = Directory("./frontend"); // Install dependencies (prefer ci for reproducible builds) Npm.Ci(frontend); // Run linting Npm.Run(frontend, "lint"); // Run tests Npm.Test(frontend); // Build for production Npm.Build(frontend); ```