18c339a94Sopenharmony_ci# VersionManagement
28c339a94Sopenharmony_ci
38c339a94Sopenharmony_ciThe `Napi::VersionManagement` class contains methods that allow information
48c339a94Sopenharmony_cito be retrieved about the version of Node-API and Node.js. In some cases it is
58c339a94Sopenharmony_ciimportant to make decisions based on different versions of the system.
68c339a94Sopenharmony_ci
78c339a94Sopenharmony_ci## Methods
88c339a94Sopenharmony_ci
98c339a94Sopenharmony_ci### GetNapiVersion
108c339a94Sopenharmony_ci
118c339a94Sopenharmony_ciRetrieves the highest Node-API version supported by Node.js runtime.
128c339a94Sopenharmony_ci
138c339a94Sopenharmony_ci```cpp
148c339a94Sopenharmony_cistatic uint32_t Napi::VersionManagement::GetNapiVersion(Env env);
158c339a94Sopenharmony_ci```
168c339a94Sopenharmony_ci
178c339a94Sopenharmony_ci- `[in] env`: The environment in which the API is invoked under.
188c339a94Sopenharmony_ci
198c339a94Sopenharmony_ciReturns the highest Node-API version supported by Node.js runtime.
208c339a94Sopenharmony_ci
218c339a94Sopenharmony_ci### GetNodeVersion
228c339a94Sopenharmony_ci
238c339a94Sopenharmony_ciRetrieves information about Node.js version present on the system. All the
248c339a94Sopenharmony_ciinformation is stored in the `napi_node_version` structure that is defined as
258c339a94Sopenharmony_cishown below:
268c339a94Sopenharmony_ci
278c339a94Sopenharmony_ci```cpp
288c339a94Sopenharmony_citypedef struct {
298c339a94Sopenharmony_ci  uint32_t major;
308c339a94Sopenharmony_ci  uint32_t minor;
318c339a94Sopenharmony_ci  uint32_t patch;
328c339a94Sopenharmony_ci  const char* release;
338c339a94Sopenharmony_ci} napi_node_version;
348c339a94Sopenharmony_ci````
358c339a94Sopenharmony_ci
368c339a94Sopenharmony_ci```cpp
378c339a94Sopenharmony_cistatic const napi_node_version* Napi::VersionManagement::GetNodeVersion(Env env);
388c339a94Sopenharmony_ci```
398c339a94Sopenharmony_ci
408c339a94Sopenharmony_ci- `[in] env`: The environment in which the API is invoked under.
418c339a94Sopenharmony_ci
428c339a94Sopenharmony_ciReturns the structure a pointer to the structure `napi_node_version` populated by
438c339a94Sopenharmony_cithe version information of Node.js runtime.
44