@@ -4,19 +4,19 @@ C++ code needs to be compiled into executable form whether it be as an object
44file to linked with others, a shared library, or a standalone executable.
55
66The main reason for this is that we need to link to the Node.js dependencies and
7- headers correctly, another reason is that we need a cross platform way to build
7+ headers correctly. Another reason is that we need a cross- platform way to build
88C++ source into binary for the target platform.
99
10- Until now ** node-gyp** is the** de-facto** standard build tool for writing
11- Node.js addons. It's based on Google's** gyp** build tool, whichabstract away
12- many of the tedious issues related to cross platform building.
10+ ** node-gyp** remains the** de-facto** standard build tool for writing
11+ Node.js addons. It's based on Google's** gyp** build tool, whichabstracts away
12+ many of the tedious issues related to cross- platform building.
1313
14- ** node-gyp** uses a file called``` binding.gyp ``` that is locatedon the root of
14+ ** node-gyp** uses a file called` binding.gyp ` that is locatedin the root of
1515your addon project.
1616
17- ``` binding.gyp ``` file, contains all building configurations organized with a
18- JSON like syntax. The most important parameter is the** target** that must be
19- set to the same value usedon the initialization code of the addon as in the
17+ The ` binding.gyp ` file contains all building configurations organized with a
18+ JSON- like syntax. The most important parameter is the** target** that must be
19+ set to the same value usedin the initialization code of the addon, as in the
2020examples reported below:
2121
2222###** binding.gyp**
@@ -41,8 +41,8 @@ examples reported below:
4141// ...
4242
4343/**
44- * This codeis our entry- point. We receive two arguments here, the firstis the
45- * environment that represent an independent instance of the JavaScript runtime,
44+ * This codeis our entry point. We receive two arguments here: the firstis the
45+ * environment that represent an independent instance of the JavaScript runtime;
4646* the secondis exports, the sameas module.exportsin a .jsfile .
4747* You can either add properties to the exportsobject passedin or create your
4848* own exportsobject . In either case you mustreturn theobject to be usedas
@@ -56,7 +56,7 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) {
5656}
5757
5858/**
59- * This code defines the entry- pointfor the Node addon, it tells Node where to go
59+ * This code defines the entry pointfor the Node addon. It tells Node where to go
6060* once the library has been loaded into active memory. The first argument must
6161* match the" target" in our* binding.gyp* . UsingNODE_GYP_MODULE_NAME ensures
6262* that the argument will be correct,as long as the moduleis builtwith
@@ -75,8 +75,8 @@ NODE_API_MODULE(NODE_GYP_MODULE_NAME, Init)
7575- [Command options](https:// www.npmjs.com/ package/ node- gyp# command-options)
7676- [Configuration](https:// www.npmjs.com/ package/ node- gyp# configuration)
7777
78- Sometimes finding the right settingsfor ``` binding.gyp``` is not easy so to
79- accomplishat most complicatedtask please refer to:
78+ Sometimes finding the right settingsfor `binding.gyp` is not easy, so to
79+ accomplishthe most complicatedtasks, please refer to:
8080
8181- [GYP documentation](https:// gyp.gsrc.io/ index.md)
82- - [node- gyp wiki](https:// github.com/ nodejs/ node- gyp/ wiki )
82+ - [node- gyp wiki](https:// github.com/ nodejs/ node- gyp/ tree / main / docs )