1
1
# BasicEnv
2
2
3
- The opaque data structure containing the environment in which the request is
4
- being run.
3
+ The data structure containing the environment in which the request is being run.
5
4
6
5
The ` Napi::BasicEnv ` object is usually created and passed by the Node.js runtime
7
6
or node-addon-api infrastructure.
@@ -50,13 +49,13 @@ void SetInstanceData(T* data) const;
50
49
- `[template] fini`: A function to call when the instance data is to be deleted.
51
50
Accepts a function of the form `void CleanupData(Napi::Env env, T* data)`. If
52
51
not given, the default finalizer will be used, which simply uses the `delete`
53
- operator to destroy `T*` when the addon instance is unloaded.
52
+ operator to destroy `T*` when the add-on instance is unloaded.
54
53
- `[in] data`: A pointer to data that will be associated with the instance of
55
- the addon for the duration of its lifecycle.
54
+ the add-on for the duration of its lifecycle.
56
55
57
56
Associates a data item stored at `T* data` with the current instance of the
58
- addon . The item will be passed to the function `fini` which gets called when an
59
- instance of the addon is unloaded.
57
+ add-on . The item will be passed to the function `fini` which gets called when an
58
+ instance of the add-on is unloaded.
60
59
61
60
### SetInstanceData
62
61
@@ -73,16 +72,16 @@ void SetInstanceData(DataType* data, HintType* hint) const;
73
72
- ` [template] fini ` : A function to call when the instance data is to be deleted.
74
73
Accepts a function of the form `void CleanupData(Napi::Env env, DataType* data,
75
74
HintType* hint)`. If not given, the default finalizer will be used, which simply
76
- uses the ` delete ` operator to destroy ` T* ` when the addon instance is unloaded.
75
+ uses the ` delete ` operator to destroy ` T* ` when the add-on instance is unloaded.
77
76
- ` [in] data ` : A pointer to data that will be associated with the instance of
78
- the addon for the duration of its lifecycle.
77
+ the add-on for the duration of its lifecycle.
79
78
- ` [in] hint ` : A pointer to data that will be associated with the instance of
80
- the addon for the duration of its lifecycle and will be passed as a hint to
81
- ` fini ` when the addon instance is unloaded.
79
+ the add-on for the duration of its lifecycle and will be passed as a hint to
80
+ ` fini ` when the add-on instance is unloaded.
82
81
83
82
Associates a data item stored at ` T* data ` with the current instance of the
84
- addon . The item will be passed to the function ` fini ` which gets called when an
85
- instance of the addon is unloaded. This overload accepts an additional hint to
83
+ add-on . The item will be passed to the function ` fini ` which gets called when an
84
+ instance of the add-on is unloaded. This overload accepts an additional hint to
86
85
be passed to ` fini ` .
87
86
88
87
### GetModuleFileName
@@ -91,10 +90,10 @@ be passed to `fini`.
91
90
const char * Napi::Env::GetModuleFileName () const ;
92
91
```
93
92
94
- Returns a A URL containing the absolute path of the location from which the
95
- add-on was loaded. For a file on the local file system it will start with
96
- ` file:// ` . The string is null-terminated and owned by env and must thus not be
97
- modified or freed. It is only valid while the add-on is loaded.
93
+ Returns a URL containing the absolute path of the location from which the add-on
94
+ was loaded. For a file on the local file system it will start with ` file:// ` .
95
+ The string is null-terminated and owned by env and must thus not be modified or
96
+ freed. It is only valid while the add-on is loaded.
98
97
99
98
### AddCleanupHook
100
99
0 commit comments