So, I got that:
void Method(const Nan::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext();
int last_number = info[0]->NumberValue(context).FromJust();
info.GetReturnValue().Set(Nan::New<(fib(last_number)));
}
https://github.com/nodejs/nan is used here I need to return a string value from this function. Function fib returns an int value. Any way to convert int to string here gives me different errors.
If
s
is aconst char *
, then: