diff --git a/binding.gyp b/binding.gyp index 9ccd9dd..7ae3337 100644 --- a/binding.gyp +++ b/binding.gyp @@ -2,8 +2,10 @@ 'targets': [ { 'target_name': 'bufferutil', - 'include_dirs': [" - -NAN_METHOD(mask) { - char* from = node::Buffer::Data(info[0]); - char* mask = node::Buffer::Data(info[1]); - char* to = node::Buffer::Data(info[2]) + info[3]->Int32Value(); - size_t length = info[4]->Int32Value(); +#include + +void mask(const Napi::CallbackInfo& info) { + char* from = info[0].As>().Data(); + char* mask = info[1].As>().Data(); + char* to = info[2].As>().Data() + + info[3].As().Int32Value(); + size_t length = info[4].As().Int32Value(); size_t index = 0; // @@ -57,10 +58,10 @@ NAN_METHOD(mask) { } } -NAN_METHOD(unmask) { - char* from = node::Buffer::Data(info[0]); - size_t length = node::Buffer::Length(info[0]); - char* mask = node::Buffer::Data(info[1]); +void unmask(const Napi::CallbackInfo& info) { + char* from = info[0].As>().Data(); + size_t length = info[0].As>().Length(); + char* mask = info[1].As>().Data(); size_t index = 0; // @@ -105,9 +106,10 @@ NAN_METHOD(unmask) { } } -NAN_MODULE_INIT(init) { - NAN_EXPORT(target, mask); - NAN_EXPORT(target, unmask); +Napi::Object init(Napi::Env env, Napi::Object exports) { + exports.Set("mask", Napi::Function::New(env, mask)); + exports.Set("unmask", Napi::Function::New(env, unmask)); + return exports; } -NODE_MODULE(bufferutil, init) +NODE_API_MODULE(bufferutil, init) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy