GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: naming function as suggested in addon docs · nodejs/node@5fa5ab6

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • addons.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/addons.md‎

Copy file name to clipboardExpand all lines: doc/api/addons.md
+4-4Lines changed: 4 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
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 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.