Skip to content

Commit 93c6ef1

Browse files
committed
docs: naming function as suggested
1 parent dcecfb7 commit 93c6ef1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/api/addons.md

Lines changed: 3 additions & 3 deletions
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,7 +95,7 @@ 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
98+
In the `hello.cc` example, then, the initialization function is `Initialize` and the
9999
Addon module name is `addon`.
100100

101101
### Building

0 commit comments

Comments
 (0)