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, runs npm install in each directory, and creates a stamp file on success. Sibling .json, .js, and .ts files are tracked as inputs so changes trigger reinstallation.

Source Files

  • Input: **/package.json (plus sibling .json, .js, .ts files)
  • Output: out/npm/{flat_name}.stamp

Configuration

[processor.npm]
npm = "npm"                            # The npm command to run
command = "install"                    # The npm subcommand to execute
args = []                              # Additional arguments to pass to npm
extra_inputs = []                      # Additional files that trigger rebuilds when changed
cache_output_dir = true                # Cache the node_modules directory for fast restore after clean
KeyTypeDefaultDescription
npmstring"npm"The npm executable to run
commandstring"install"The npm subcommand to execute
argsstring[][]Extra arguments passed to npm
extra_inputsstring[][]Extra files whose changes trigger rebuilds
cache_output_dirbooleantrueCache the node_modules/ directory so rsconstruct clean && rsconstruct build restores from cache