forked from kenny-y/wn-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddon.cpp
46 lines (36 loc) · 1.03 KB
/
addon.cpp
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <node.h>
#include <nan.h>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <thread>
#include <algorithm>
#include <chrono>
#include <tuple>
#include "nan__meal.h"
#include "nan__log_severity.h"
#include "nan__distortion.h"
#include "nan__preset.h"
#include "nan__stream.h"
#include "nan__format.h"
#include "nan__option.h"
NAN_METHOD(HelloWorld) {
printf("Old fashion way to say hello in C\n");
}
// Returns a simple type value to JavaScript
NAN_METHOD(ReturnValueToJS) {
// info is the default parameter name defined in <nan.h>:1297
info.GetReturnValue().Set(Nan::New("Hello from C++").ToLocalChecked());
}
void initModule(v8::Local<v8::Object> exports) {
Nan::Export(exports, "helloWorld", HelloWorld);
Nan::Export(exports, "returnValueToJS", ReturnValueToJS);
NanMeal::Init(exports);
Nanlog_severity::Init(exports);
Nandistortion::Init(exports);
Nanpreset::Init(exports);
Nanstream::Init(exports);
Nanformat::Init(exports);
Nanoption::Init(exports);
}
NODE_MODULE(exampleAddon1, initModule);