forked from ivere27/toby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
28 lines (20 loc) · 661 Bytes
/
app.js
File metadata and controls
28 lines (20 loc) · 661 Bytes
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
'use strict'
// print toby.version
console.log(`node :: toby.version = ${toby.version}`);
// assgined from example.cpp
console.log(`node :: _v = ${_v}`);
var num = 42;
var foo = 'foo';
toby.on('test', function(x){
console.log(`node :: toby.on(test) = ${x}`);
});
var result = toby.hostCall('dory', {num, foo});
console.log(`node :: toby.hostCall() = ${result}`);
process.on('test', toby.hostOn('exit'))
process.on('exit', toby.hostOn('exit'));
//process.on('exit', function(code){console.log(`exit with ${code}`)});
process.emit('test', 'a', 20, {num, foo});
// exit after 2 secs
(function(){setTimeout(function(){
process.exitCode = 42;
},2000)})();