It's been a long time since I've used C++, and even longer since I wrapped my head around hard types. I'm simply looking for a working one liner to do get an argument from v8, or a default value when an argument wasn't…
I want my C library to be able to call a JS function multiple times. I got it to work using Nan but am having trouble converting it to N-API/node-addon-api.
How do I save a JS callback function and call it later from C?
Here's what I have using…
I implemented a c++ addon module that creates some buffer using unsigned char(uint8_t) memory and delivers it to node.js.
---- c++ addon.cpp ----
void get_frame_buffer(const FunctionCallbackInfo& args){
Isolate* isolate =…
In short, I have an addon that completes an operation which results in a uint8_t array. I need to convert this array and its contents to an ArrayBuffer, and return that.
Conversely, the addon can also accept an ArrayBuffer as input, and I need to…
I'm trying to integrate C++ with HTML using Electron and Node JS.But I'm confused by the NODE_MODULE_VERSION.
I have a binding.gyp like examples.
{
"targets": [
{
"target_name": "addon",
"sources": [ "src/hello.cc" ],
…
I'm developing a project for webOS 3.0 and I want to know if it's possible to integrate a C++ lib binary on a webOS aplication. I am tying to use nodejs addons and require the addon.node file into a JSservice like a module, but, according to this…
I have two subclasses of Nan::ObjectWrap
class Zyre: public Nan::ObjectWrap {...}
class ZyreEvent: public Nan::ObjectWrap {...}
How can I return a ZyreEvent javascript object from a method in Zyre?
I have the following method, in which I create a…
I would like to call a nodejs callback from within my asynchronous addon function. I have seen the synchronous example (here)
and I am using a wonderful asynchronous example (here) as a starting base.
However, when I try to execute a callback that…
Hi I am a noob in C++ trying to modify an existing native node module.
I am trying to add couts inside the module to print info I think is useful for me.
NAN_METHOD(Context2d::SetFillRule){
Context2d *context =…
I have a c++ lib, client application use this lib to query data from server. This lib create a seperate thread to communicate with server, query result will be passed as parameters in callback function.
Now i want to wrap this c++ lib to nodejs…
Nan 2.0, for compatibility with Node 4.0, introduced Maybe and MaybeLocal types, and several functions that return them. However, most of them do not seem to accept Maybe objects, and in several cases I would want to compose those methods. For…
I'm writing a Node plugin and I'm having problems trying to call a V8 function object from a C++ worker thread.
My plugin basically starts a C++ std::thread and enters a wait loop using WaitForSingleOject(), this is triggered by a different C++ app…
I am trying to implement a C++ extension to be integrated with node.js. This extension will internally invoke some blocking calls, so it needs to provide a non-blocking interface to the node.js world.
As specified in…
I'd like to make use of the V8 Float32Array data structure. How can I initialise it?
I'd also be interested in direct memory access to the data. How could that be done?