diff --git a/examples/Makefile b/examples/Makefile index 5238f938..0b0faee8 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -16,8 +16,10 @@ clean: make -C cleanup clean make -C logging clean +install: + npm install -test: test-function test-cb test-async-cb test-promise test-json test-class-simple \ +test: install test-function test-cb test-async-cb test-promise test-json test-class-simple \ test-class-wrapper test-class-async test-stream test-buffer test-array test-bigint test-logging\ test-cleanup diff --git a/examples/class-async/test.js b/examples/class-async/test.js index a50dad17..cb81632d 100644 --- a/examples/class-async/test.js +++ b/examples/class-async/test.js @@ -1,18 +1,20 @@ const assert = require('assert'); +const SegfaultHandler = require('segfault-handler'); +SegfaultHandler.registerHandler('crash.log'); let addon = require('./dist'); let obj = new addon.MyObject(10); -obj.plusTwo(10).then( (val) => { - console.log("plus two is ",val); +obj.plusTwo(10).then((val) => { + console.log("plus two is ", val); }); -obj.multiply2(-1).then( (obj3) => { - console.log("multiply two ",obj3.value); +obj.multiply2(-1).then((obj3) => { + console.log("multiply two ", obj3.value); }); obj.sleep((msg) => { - assert.equal(msg,"hello world");; + assert.equal(msg, "hello world");; }); diff --git a/examples/package-lock.json b/examples/package-lock.json new file mode 100644 index 00000000..c0b8b563 --- /dev/null +++ b/examples/package-lock.json @@ -0,0 +1,44 @@ +{ + "name": "node-bindgen-examples", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "node-bindgen-examples", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "segfault-handler": "^1.3.0" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, + "node_modules/nan": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz", + "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==" + }, + "node_modules/segfault-handler": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/segfault-handler/-/segfault-handler-1.3.0.tgz", + "integrity": "sha512-p7kVHo+4uoYkr0jmIiTBthwV5L2qmWtben/KDunDZ834mbos+tY+iO0//HpAJpOFSQZZ+wxKWuRo4DxV02B7Lg==", + "hasInstallScript": true, + "dependencies": { + "bindings": "^1.2.1", + "nan": "^2.14.0" + } + } + } +} diff --git a/examples/package.json b/examples/package.json new file mode 100644 index 00000000..46c57f34 --- /dev/null +++ b/examples/package.json @@ -0,0 +1,14 @@ +{ + "name": "node-bindgen-examples", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "segfault-handler": "^1.3.0" + } +}