Skip to content

Commit 4e663ec

Browse files
allevotargos
authored andcommitted
doc: naming function as suggested in addon docs
PR-URL: #21067 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 2387c41 commit 4e663ec

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/api/addons.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ void Method(const FunctionCallbackInfo<Value>& args) {
7272
args.GetReturnValue().Set(String::NewFromUtf8(isolate, "world"));
7373
}
7474

75-
void init(Local<Object> exports) {
75+
void Initialize(Local<Object> exports) {
7676
NODE_SET_METHOD(exports, "hello", Method);
7777
}
7878

79-
NODE_MODULE(NODE_GYP_MODULE_NAME, init)
79+
NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize)
8080

8181
} // namespace demo
8282
```
@@ -95,8 +95,8 @@ There is no semi-colon after `NODE_MODULE` as it's not a function (see
9595
The `module_name` must match the filename of the final binary (excluding
9696
the `.node` suffix).
9797

98-
In the `hello.cc` example, then, the initialization function is `init` and the
99-
Addon module name is `addon`.
98+
In the `hello.cc` example, then, the initialization function is `Initialize`
99+
and the addon module name is `addon`.
100100

101101
### Building
102102

0 commit comments

Comments
 (0)