Skip to content

Commit

Permalink
feat: add register.js
Browse files Browse the repository at this point in the history
  • Loading branch information
killagu committed Feb 1, 2025
1 parent 4b59d4a commit 0aab2d0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ crate-type = ["cdylib"]
napi = { version = "2.12.2", default-features = false, features = ["napi4"] }
napi-derive = "2.12.2"
nix = { version = "0.29.0", features = ["signal"] }
v8 = "130.0.7"
cc = "1.2.10"
bitflags = "2.8.0"

Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@
npm i --save node-segfault-handler-rs
```

Manually register.

```js
const { register } = require('node-segfault-handler-rs');

register();
```

Use node `-r` option

```shell
node -r node-segfault-handler-rs/register
```

## Log
```shell
rust backtrace start
Expand Down
3 changes: 3 additions & 0 deletions register.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const { register } = require('./index');

Check failure on line 1 in register.js

View workflow job for this annotation

GitHub Actions / Test bindings on Linux-x64-gnu - node@20

Require statement not part of import statement

Check failure on line 1 in register.js

View workflow job for this annotation

GitHub Actions / Test bindings on Linux-x64-gnu - node@22

Require statement not part of import statement

Check failure on line 1 in register.js

View workflow job for this annotation

GitHub Actions / Test bindings on macos - node@20

Require statement not part of import statement

Check failure on line 1 in register.js

View workflow job for this annotation

GitHub Actions / Test bindings on macos - node@22

Require statement not part of import statement

register();

0 comments on commit 0aab2d0

Please sign in to comment.