summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorlegendecas <legendecas@gmail.com>2019-11-21 00:55:36 +0800
committerAnna Henningsen <anna@addaleax.net>2019-12-03 23:44:10 +0100
commit3ebae6cf1b20ce104423214d75c3c84129a8f141 (patch)
tree12fd6bcfb86f17d050e4c04402c4ab188bb8cd5e /doc
parenta025c5a8745637aa5f6e06acab0c15461a920d8e (diff)
downloadandroid-node-v8-3ebae6cf1b20ce104423214d75c3c84129a8f141.tar.gz
android-node-v8-3ebae6cf1b20ce104423214d75c3c84129a8f141.tar.bz2
android-node-v8-3ebae6cf1b20ce104423214d75c3c84129a8f141.zip
worker: add argv constructor option
A convenience option to populate `process.argv` in worker threads. PR-URL: https://github.com/nodejs/node/pull/30559 Fixes: https://github.com/nodejs/node/issues/30531 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/worker_threads.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md
index b334a1091b..a93bd5422e 100644
--- a/doc/api/worker_threads.md
+++ b/doc/api/worker_threads.md
@@ -510,6 +510,9 @@ changes:
- version: v13.2.0
pr-url: https://github.com/nodejs/node/pull/26628
description: The `resourceLimits` option was introduced.
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/30559
+ description: The `argv` option was introduced.
-->
* `filename` {string} The path to the Worker’s main script. Must be
@@ -518,6 +521,10 @@ changes:
If `options.eval` is `true`, this is a string containing JavaScript code
rather than a path.
* `options` {Object}
+ * `argv` {any[]} List of arguments which would be stringified and appended to
+ `process.argv` in the worker. This is mostly similar to the `workerData`
+ but the values will be available on the global `process.argv` as if they
+ were passed as CLI options to the script.
* `env` {Object} If set, specifies the initial value of `process.env` inside
the Worker thread. As a special value, [`worker.SHARE_ENV`][] may be used
to specify that the parent thread and the child thread should share their