Skip to content

Instantly share code, notes, and snippets.

@sagivo sagivo/5.cc
Created Sep 30, 2015

Embed
What would you like to do?
void GetBuffer(const FunctionCallbackInfo<Value>& args) {
char *data;
size_t length;
GetSomeBufferData(data, length);
MaybeLocal<Object> buffer = Nan::CopyBuffer(data, length);
delete []data;
args.GetReturnValue().Set(buffer.ToLocalChecked());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.