This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var addon = require('bindings')('hello'); | |
console.log(addon.hello()); // 'world' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <nan.h> | |
void Method(const Nan::FunctionCallbackInfo<v8::Value>& info) { | |
info.GetReturnValue().Set(Nan::New("world").ToLocalChecked()); | |
} | |
void Init(v8::Local<v8::Object> exports) { | |
exports->Set(Nan::New("hello").ToLocalChecked(), | |
Nan::New<v8::FunctionTemplate>(Method)->GetFunction()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var addon = require('bindings')('addon'); | |
addon(function(msg){ | |
console.log(msg); // 'hello world' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <nan.h> | |
void RunCallback(const Nan::FunctionCallbackInfo<v8::Value>& info) { | |
v8::Local<v8::Function> cb = info[0].As<v8::Function>(); | |
const unsigned argc = 1; | |
v8::Local<v8::Value> argv[argc] = { Nan::New("hello world").ToLocalChecked() }; | |
Nan::MakeCallback(Nan::GetCurrentContext()->Global(), cb, argc, argv); | |
} | |
void Init(v8::Local<v8::Object> exports, v8::Local<v8::Object> module) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); | |
var streamNode; | |
var masterNode; | |
var bypassNode; | |
var delayNode; | |
var feedbackNode; | |
//request an audio MediaStream track and save a reference to it | |
navigator.mediaDevices.getUserMedia({audio: true}) | |
.then(stream => { |