From 4416cc0df40fa979ba893fd3efd792ce2a50ada6 Mon Sep 17 00:00:00 2001 From: Mert Can Altin Date: Fri, 21 Mar 2025 23:13:41 +0300 Subject: [PATCH 01/10] src: add --run-from runtime flag --- doc/api/cli.md | 16 +++++++++++++ src/node_options.cc | 3 +++ src/node_options.h | 1 + src/node_task_runner.cc | 11 ++++++++- test/parallel/test-node-run.js | 42 ++++++++++++++++++++++++++++++++++ 5 files changed, 72 insertions(+), 1 deletion(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 63e68244e75d7d..b08834510d4045 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -2294,6 +2294,22 @@ The following environment variables are set when running a script with `--run`: * `NODE_RUN_PACKAGE_JSON_PATH`: The path to the `package.json` that is being processed. +### `--run-from=` + + + +> Stability: 1.0 - Early development + +Run a script defined in the package.json located in the specified directory. + +For example: + +```bash +node --run-from=/path/to/dir --run test +``` + ### `--secure-heap-min=n`