Skip to content

Commit

Permalink
- Update package version
Browse files Browse the repository at this point in the history
- Add try to sig-handler for unsupported abi
  • Loading branch information
wilix-lead committed Apr 20, 2017
1 parent fe0f406 commit 8650b4b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ I really hope find way for use build systems for online build or download prebui
Before install this module, you need specify build runtime.
Just add following to your package.json file
(if you use two-package-json structure, add to app's package.json, not to build).
Checkout your ABI for [node.js](https://nodejs.org/en/download/releases/) or [electron](https://www.npmjs.com/package/electron-abi)
```json
"iohook": {
"targets": [
Expand Down
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
const os = require('os');
const EventEmitter = require('events');
const path = require('path');
const SegfaultHandler = require('segfault-handler');

SegfaultHandler.registerHandler("iohook-crash.log");
// Try use handler if runtime and ABI is compatible
try {
const SegfaultHandler = require('segfault-handler');
SegfaultHandler.registerHandler("iohook-crash.log");
} catch (e) {}

const runtime = process.versions['electron'] ? 'electron' : 'node';
const essential = runtime + '-v' + process.versions.modules + '-' + process.platform + '-' + process.arch;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iohook",
"version": "0.1.7",
"version": "0.1.8",
"description": "Node.js global keyboard and mouse hook",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 8650b4b

Please sign in to comment.