Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naming Initialize as Initialize like docs says #21067

Closed
wants to merge 1 commit into from
Closed
Changes from all 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
6 changes: 3 additions & 3 deletions doc/api/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ void Method(const FunctionCallbackInfo<Value>& args) {
args.GetReturnValue().Set(String::NewFromUtf8(isolate, "world"));
}

void init(Local<Object> exports) {
void Initialize(Local<Object> exports) {
NODE_SET_METHOD(exports, "hello", Method);
}

NODE_MODULE(NODE_GYP_MODULE_NAME, init)
NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize)

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

In the `hello.cc` example, then, the initialization function is `init` and the
In the `hello.cc` example, then, the initialization function is `Initialize` and the
Addon module name is `addon`.

### Building
Expand Down