Native extensions for Deno?

Does something like n-api exist for deno? Can't find it in the manual
8 Replies
Andreu Botella (they/them)
Deno
Foreign Function Interface API | Manual | Deno
As of Deno 1.13 and later, the FFI (foreign function interface) API allows users to call libraries written in native languages that support the C ABIs (C/C++, Rust, Zig, etc.) using Deno.dlopen.
Andreu Botella (they/them)
you can find a lot more info about FFI in https://denonomicon.deno.dev/ (maintained by @aapoalas, not by the Deno core team)
Lewis Campbell
FFI is not the same thing as native extensions. Native extensions: you write code in C (or whatever), and wrap it in deno types from some header file. you can then import this as a module.
Andreu Botella (they/them)
then no, there's nothing like that there's a PR to add support for n-api, but it's many months old and is unlikely to get merged anytime soon
Lewis Campbell
ok, thanks. just making sure it wasn't called something else
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
NeTT
NeTT3y ago
GitHub
feat: implement Node API by littledivy · Pull Request #13633 · deno...
This PR implements the NAPI for loading native modules into Deno. Feature tracking Environment life cycle APIs napi_set_instance_data napi_get_instance_data Basic Node-API data types napi...
NeTT
NeTT3y ago
This?