阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js N-API napi_get_version

      Node.js N-API napi_get_version

      新增于: v8.0.0 N-API version: 1 napi_status napi_get_version(napi_env env, uint32_t* result); [in] env: The environment that the API is invoked under. [out] result: The highest version of N-API supported. Returns napi_ok if the API succeeded.

      This API returns the highest N-API version supported by the Node.js runtime. N-API is planned to be additive such that newer releases of Node.js may support additional API functions. In order to allow an addon to use a newer function when running with versions of Node.js that support it, while providing fallback behavior when running with Node.js versions that don’t support it:

      Call napi_get_version() to determine if the API is available. If available, dynamically load a pointer to the function using uv_dlsym(). Use the dynamically loaded pointer to invoke the function. If the function is not available, provide an alternate implementation that does not use the function.


      更多内容请参考:Node.js N-API,或者通过 点击对应菜单 进行查看;


      目录
      本文目录
      目录