1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
#include <nan.h>
#include "sync.h" // NOLINT(build/include_subdir)
#include "async.h" // NOLINT(build/include_subdir)
using v8::FunctionTemplate;
using v8::Object;
using v8::String;
using Nan::GetFunction;
using Nan::New;
using Nan::Set;
// Expose synchronous and asynchronous access to our
// Estimate() function
NAN_MODULE_INIT(InitAll) {
Set(target, New<String>("calculateSync").ToLocalChecked(),
GetFunction(New<FunctionTemplate>(CalculateSync)).ToLocalChecked());
Set(target, New<String>("calculateAsync").ToLocalChecked(),
GetFunction(New<FunctionTemplate>(CalculateAsync)).ToLocalChecked());
}
NODE_MODULE(addon, InitAll)
|