Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ added: v6.0.0

Silence all process warnings (including deprecations).

### `--napi-modules`
<!-- YAML
added: v8.0.0
-->

Load N-API modules (experimental, opt-in by adding this flag).

### `--trace-warnings`
<!-- YAML
added: v6.0.0
Expand Down
4 changes: 4 additions & 0 deletions doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ Throw errors for deprecations.
.BR \-\-no\-warnings
Silence all process warnings (including deprecations).

.TP
.BR \-\-napi\-modules
Load N-API modules (experimental, opt-in by adding this flag).

.TP
.BR \-\-trace\-warnings
Print stack traces for process warnings (including deprecations).
Expand Down
9 changes: 3 additions & 6 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2471,7 +2471,8 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
sizeof(errmsg),
"The module '%s'"
"\nwas compiled against the Node.js API. This feature is "

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

"\nexperimental and must be enabled on the command-line.",
"\nexperimental and must be enabled on the command-line by "
"\nadding --napi-modules.",
*filename);
} else {
snprintf(errmsg,
Expand Down Expand Up @@ -3548,7 +3549,7 @@ static void PrintHelp() {
" --trace-deprecation show stack traces on deprecations\n"
" --throw-deprecation throw an exception on deprecations\n"
" --no-warnings silence all process warnings\n"
" --napi-modules[=yes|no] load N-API modules (default no)\n"
" --napi-modules load N-API modules\n"
" --trace-warnings show stack traces on process warnings\n"
" --redirect-warnings=path\n"
" write warnings to path instead of\n"
Expand Down Expand Up @@ -3721,10 +3722,6 @@ static void ParseArgs(int* argc,
no_deprecation = true;
} else if (strcmp(arg, "--napi-modules") == 0) {
load_napi_modules = true;
} else if (strcmp(arg, "--napi-modules=yes") == 0) {
load_napi_modules = true;
} else if (strcmp(arg, "--napi-modules=no") == 0) {
load_napi_modules = false;
} else if (strcmp(arg, "--no-warnings") == 0) {
no_process_warnings = true;
} else if (strcmp(arg, "--trace-warnings") == 0) {
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/testcfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
import testpy

def GetConfiguration(context, root):
return testpy.AddonTestConfiguration(context, root, 'addons-napi', ['--napi-modules=yes'])
return testpy.AddonTestConfiguration(context, root, 'addons-napi', ['--napi-modules'])