-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JS Code in the native node module #528
Comments
If I got it right, the key might be a module API in N-API to allow N-API modules to directly access other type of modules. Currently you have to pass A module API is being proposed on nodejs/node#28464. |
@sudhakar3697 you can call JavaScript functions, but is up to you to get those to the N-API module. For example if you pass the result of fs = require('fs') to an N-API function it can use N-API methods to get fields/functions on that an then call them. Having said that it might be easier to keep some of that functionality in JS and call a higher level function from the N-API C function as opposed to making many of those calls in the N-API functcion. I also believe it would likely be better optimized with more of the calls together at the JS level as each back and forth adds overhead. |
Is it possible to access the following variants of node modules inside the N-API addon code(C/C++).
Thank you.
The text was updated successfully, but these errors were encountered: