Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Npm Processor

Purpose

Installs Node.js dependencies from package.json files using npm.

How It Works

Discovers package.json files in the project and runs npm install in each directory. Sibling .json, .js, and .ts files are tracked as inputs so changes trigger reinstallation. After a successful install it writes a deterministic install stamp, out/processor.mass_generator.npm/root.stamp for a root package.json (or <dir>.stamp with / turned into _ otherwise).

Source Files

  • Input: **/package.json (plus sibling .json, .js, .ts files)
  • Output: the install stamp out/processor.mass_generator.npm/<dir>.stamp

Configuration

[processor.mass_generator.npm]
command = "npm"                        # The npm command to run
args = []                              # Additional arguments to pass to npm install
dep_inputs = []                        # Additional files that trigger rebuilds when changed
KeyTypeDefaultDescription
commandstring"npm"The npm executable to run
argsstring[][]Extra arguments passed to npm install
dep_inputsstring[][]Extra files whose changes trigger rebuilds

Batch support

Runs once per package.json when its install stamp product is dirty.

Clean behavior

This processor is a Mass Generator — rsconstruct clean outputs removes each planned install stamp (product.outputs) and sweeps any parent directories that become empty. See Clean behavior and rsconstruct clean.