diff options
| author | 8cy <[email protected]> | 2020-04-03 02:37:42 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-03 02:37:42 -0700 |
| commit | 60867fb030bae582082340ead7dbc7efdc2f5398 (patch) | |
| tree | 4c6a7356351be2e4914e15c4703172597c45656e /node_modules/node-addon-api/doc/version_management.md | |
| parent | commenting (diff) | |
| download | s5nical-60867fb030bae582082340ead7dbc7efdc2f5398.tar.xz s5nical-60867fb030bae582082340ead7dbc7efdc2f5398.zip | |
2020/04/03, 02:34, v1.2.0
Diffstat (limited to 'node_modules/node-addon-api/doc/version_management.md')
| -rw-r--r-- | node_modules/node-addon-api/doc/version_management.md | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/node_modules/node-addon-api/doc/version_management.md b/node_modules/node-addon-api/doc/version_management.md new file mode 100644 index 0000000..6d6c7fa --- /dev/null +++ b/node_modules/node-addon-api/doc/version_management.md @@ -0,0 +1,43 @@ +# VersionManagement + +The `Napi::VersionManagement` class contains methods that allow information +to be retrieved about the version of N-API and Node.js. In some cases it is +important to make decisions based on different versions of the system. + +## Methods + +### GetNapiVersion + +Retrieves the highest N-API version supported by Node.js runtime. + +```cpp +static uint32_t Napi::VersionManagement::GetNapiVersion(Env env); +``` + +- `[in] env`: The environment in which the API is invoked under. + +Returns the highest N-API version supported by Node.js runtime. + +### GetNodeVersion + +Retrives information about Node.js version present on the system. All the +information is stored in the `napi_node_version` structrue that is defined as +shown below: + +```cpp +typedef struct { + uint32_t major; + uint32_t minor; + uint32_t patch; + const char* release; +} napi_node_version; +```` + +```cpp +static const napi_node_version* Napi::VersionManagement::GetNodeVersion(Env env); +``` + +- `[in] env`: The environment in which the API is invoked under. + +Returns the structure a pointer to the structure `napi_node_version` populated by +the version information of Node.js runtime. |