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

CommandDescription
testRuns the test script via npm run test.
runRuns an arbitrary npm script via npm run <target>.
installInstalls packages with npm ci, honoring the lock file.
execExecutes a package binary via npm exec.
buildRuns 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