Rename requireNodeAddon to dlopen?
#263
kraenhansen
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In Node.js there's a couple of API you can use to initialize a Node-API addon:
process.dlopen({ export: {} }, "./foo")require("./foo")process._linkedBinding("foo")to load Node-API addons statically linked into the executable and registered on startup.It turns out
process.dlopendoesn't actually require an absolute or relative file path, when given a filename it will attempt to load a system-level dynamic library using a couple of candidate paths, much like what we want to do in ourrequireNodeAddonimplementation.Would we want to converge some of the naming here? I mean, we'd likely not want to overload
requireand we probably also wouldn't like to provide aprocessglobal, but perhaps we want to exportdlopenand / orlinkedBindingfrom the host package?Beta Was this translation helpful? Give feedback.
All reactions