@@ -81,12 +81,23 @@ To use **Node-API** in a native module:
8181At build time, the Node-API back-compat library code will be used only when the
8282targeted node version *does not* have Node-API built-in.
8383
84- The preprocessor directive `NODE_ADDON_API_DISABLE_DEPRECATED` can be defined at
85- compile time before including `napi.h` to skip the definition of deprecated APIs.
84+ The `NODE_ADDON_API_DISABLE_DEPRECATED` preprocessor directive can be defined at
85+ compile time before including `napi.h` to skip the definition of deprecated
86+ APIs.
8687
8788By default, throwing an exception on a terminating environment (eg. worker
8889threads) will cause a fatal exception, terminating the Node process. This is to
8990provide feedback to the user of the runtime error, as it is impossible to pass
90- the error to JavaScript when the environment is terminating. In order to bypass
91- this behavior such that the Node process will not terminate, define the
92- preprocessor directive `NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS`.
91+ the error to JavaScript when the environment is terminating. The
92+ `NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS` preprocessor directive can be defined
93+ to bypass this behavior, such that the Node process will not terminate.
94+
95+ Various Node-API constructs provide a mechanism to run a callback in response to
96+ a garbage collection event of that object. These callbacks are called
97+ [_finalizers_ ]. Some finalizers have restrictions on the type of Node-APIs
98+ available within the callback. node-addon-api provides convenience helpers that
99+ bypass this limitation, but may cause the add-on to run less efficiently. The
100+ `NODE_ADDON_API_REQUIRE_BASIC_FINALIZERS` preprocessor directive can be defined
101+ to disable the convenience helpers.
102+
103+ [_finalizers_ ]: ./finalization.md
0 commit comments