npm
Provides build, test, and exec helpers for projects that use npm and a package.json at the project root.
Infers dependencies from package.json to wire Terrabuild graphs and defaults outputs to dist/**.
Available Commands
| Command | Description |
|---|---|
| test | Runs the test script via npm run test. |
| run | Runs an arbitrary npm script via npm run <target>. |
| install | Installs packages with npm ci, honoring the lock file. |
| exec | Executes a package binary via npm exec. |
| build | Runs the build script via npm run build. |
| <command> | Runs an arbitrary npm command (forwards the Terrabuild action name to npm). |
Project Initializer
Infers project metadata from package.json (dependencies and default outputs).
project {
@npm { }
}Equivalent to:
project {
ignores = [ "node_modules/**" ]
outputs = [ "dist/**" ]
}Last updated on