diff --git a/configure b/configure index 7272e19261b238..1eaf26c0955575 100755 --- a/configure +++ b/configure @@ -444,6 +444,11 @@ parser.add_option('--without-ssl', dest='without_ssl', help='build without SSL (disables crypto, https, inspector, etc.)') +parser.add_option('--without-node-options', + action='store_true', + dest='without_node_options', + help='build without NODE_OPTIONS support') + parser.add_option('--xcode', action='store_true', dest='use_xcode', @@ -975,6 +980,9 @@ def configure_openssl(o): o['variables']['openssl_no_asm'] = 1 if options.openssl_no_asm else 0 if options.use_openssl_ca_store: o['defines'] += ['NODE_OPENSSL_CERT_STORE'] + o['variables']['node_without_node_options'] = b(options.without_node_options) + if options.without_node_options: + o['defines'] += ['NODE_WITHOUT_NODE_OPTIONS'] if options.openssl_fips: o['variables']['openssl_fips'] = options.openssl_fips fips_dir = os.path.join(root_dir, 'deps', 'openssl', 'fips') diff --git a/doc/api/cli.md b/doc/api/cli.md index 09fabb77334ff3..8346a262d9c433 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -332,6 +332,41 @@ added: v6.11.0 When set to `1`, process warnings are silenced. +### `NODE_OPTIONS=options...` + + +`options...` are interpreted as if they had been specified on the command line +before the actual command line (so they can be overriden). Node will exit with +an error if an option that is not allowed in the environment is used, such as +`-p` or a script file. + +Node options that are allowed are: +- `--enable-fips` +- `--force-fips` +- `--icu-data-dir` +- `--no-deprecation` +- `--no-warnings` +- `--openssl-config` +- `--prof-process` +- `--redirect-warnings` +- `--require`, `-r` +- `--throw-deprecation` +- `--trace-deprecation` +- `--trace-events-enabled` +- `--trace-sync-io` +- `--trace-warnings` +- `--track-heap-objects` +- `--use-bundled-ca` +- `--use-openssl-ca` +- `--v8-pool-size` +- `--zero-fill-buffers` + +V8 options that are allowed are: +- `--max_old_space_size` + + ### `NODE_REPL_HISTORY=file`