8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d4284a4 commit 173f297Copy full SHA for 173f297
doc/api/n-api.md
@@ -2877,15 +2877,17 @@ napi_value SayHello(napi_env env, napi_callback_info info) {
2877
return nullptr;
2878
}
2879
2880
-void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
+napi_value Init(napi_env env, napi_value exports) {
2881
napi_status status;
2882
2883
napi_value fn;
2884
- status = napi_create_function(env, NULL, SayHello, NULL, &fn);
2885
- if (status != napi_ok) return;
+ status = napi_create_function(env, nullptr, 0, SayHello, nullptr, &fn);
+ if (status != napi_ok) return nullptr;
2886
2887
status = napi_set_named_property(env, exports, "sayHello", fn);
2888
2889
+
2890
+ return exports;
2891
2892
2893
NAPI_MODULE(addon, Init)